]> source.dussan.org Git - jgit.git/commitdiff
Correct progress monitor on "Getting sizes:" phase 42/4642/2
authorShawn O. Pearce <spearce@spearce.org>
Thu, 17 Nov 2011 15:21:22 +0000 (07:21 -0800)
committerShawn O. Pearce <spearce@spearce.org>
Fri, 18 Nov 2011 23:55:51 +0000 (15:55 -0800)
This counter always was running 1 higher, because it incremented
after the queue was exhausted (and every object was processed). Move
increments to be after the queue has provided a result, to ensure
we do not show a higher in-progress count than total count.

Change-Id: I97f815a0492c0957300475af409b6c6260008463

org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/PackWriter.java

index 95fc7a9e5edbfc7374de7b7fb6b2d9c88958c300..f088d3224cb48699b4e457e5c1711bbc6524f89b 100644 (file)
@@ -1041,12 +1041,11 @@ public class PackWriter {
                try {
                        final long limit = config.getBigFileThreshold();
                        for (;;) {
-                               monitor.update(1);
-
                                try {
                                        if (!sizeQueue.next())
                                                break;
                                } catch (MissingObjectException notFound) {
+                                       monitor.update(1);
                                        if (ignoreMissingUninteresting) {
                                                ObjectToPack otp = sizeQueue.getCurrent();
                                                if (otp != null && otp.isEdge()) {
@@ -1076,6 +1075,7 @@ public class PackWriter {
 
                                else
                                        otp.setWeight((int) sz);
+                               monitor.update(1);
                        }
                } finally {
                        sizeQueue.release();