Fix "done" message in MultiProgressMonitor for no work done

We had an extra leading comma, which wouldn't show up in normal cases
because ReceiveCommits always does something (at least one ref
update). But in the catch clause in AsyncReceiveCommits, we
potentially reject commands after the progress monitor is finished,
possibly even before starting any tasks.

Change-Id: I0ef91aaa0147719bc773011199d278817260e695
This commit is contained in:
Dave Borowitz
2012-03-13 14:47:32 -07:00
parent 97f38ace82
commit bf3860ceef

View File

@@ -253,7 +253,17 @@ public class MultiProgressMonitor {
private void sendDone() {
spinnerState = NO_SPINNER;
StringBuilder s = format();
s.append(", done \n");
boolean any = false;
for (Task t : tasks) {
if (t.count != 0) {
any = true;
break;
}
}
if (any) {
s.append(", ");
}
s.append("done \n");
send(s);
}