Browse Source

Correct progress monitor on "Getting sizes:" phase

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
stable-1.2
Shawn O. Pearce 13 years ago
parent
commit
29997ab084
  1. 4
      org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/PackWriter.java

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

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

Loading…
Cancel
Save