mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Bug
- Fixed a divide-by-zero bug in the project completion calculations, that was uncovered by sync testing.
This commit is contained in:
parent
533bbedd81
commit
6af7540fe7
1 changed files with 5 additions and 1 deletions
|
@ -2874,10 +2874,14 @@ std::string onProjectChange (Task& task, bool scope /* = true */)
|
|||
countTasks (context.tdb.getAllNew (), project, "nope", count_pending, count_done);
|
||||
countTasks (context.tdb.getAllModified (), project, "nope", count_pending, count_done);
|
||||
|
||||
int percentage = 0;
|
||||
if (count_done + count_pending > 0)
|
||||
percentage = (count_done * 100 / (count_done + count_pending));
|
||||
|
||||
msg << "Project '"
|
||||
<< project
|
||||
<< "' is "
|
||||
<< (count_done * 100 / (count_done + count_pending))
|
||||
<< percentage
|
||||
<< "% complete ("
|
||||
<< count_pending
|
||||
<< " of "
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue