diff options
author | Roberto Tyley <roberto.tyley@gmail.com> | 2013-05-18 22:52:55 +0100 |
---|---|---|
committer | Robin Stocker <robin@nibor.org> | 2013-05-19 13:20:47 +0200 |
commit | b4b3999f8221c4c5885aef541abb4a411a9fdcbe (patch) | |
tree | 3eb99bdd9bbbc73b6b5924b5926de476dc00be11 /org.eclipse.jgit | |
parent | 84ad4957c6a1479032ad24a216904f87f1e02f40 (diff) | |
download | jgit-b4b3999f8221c4c5885aef541abb4a411a9fdcbe.tar.gz jgit-b4b3999f8221c4c5885aef541abb4a411a9fdcbe.zip |
Fix BatchRefUpdate progress-monitoring so it doesn't count twice
I was seeing output like this while running The BFG:
Updating references: 200% (374/187)
...issue sneaked in with 5cf53fda I think.
The update call is also moved to the end of the loop, as update() is
only supposed to be called after work has been done ("Denote that some
work units have been completed").
Change-Id: I1620fa75be16dc80df44745d0e123ea512762e31
Signed-off-by: Robin Stocker <robin@nibor.org>
Diffstat (limited to 'org.eclipse.jgit')
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/lib/BatchRefUpdate.java | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/BatchRefUpdate.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/BatchRefUpdate.java index b86d6fad84..b369d0d1f5 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/BatchRefUpdate.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/BatchRefUpdate.java @@ -294,8 +294,6 @@ public class BatchRefUpdate { // Now to the update that may require more room in the name space for (ReceiveCommand cmd : commands2) { try { - monitor.update(1); - if (cmd.getResult() == NOT_ATTEMPTED) { cmd.updateType(walk); RefUpdate ru = newUpdate(cmd); @@ -305,7 +303,6 @@ public class BatchRefUpdate { break; case UPDATE: case UPDATE_NONFASTFORWARD: - monitor.update(1); RefUpdate ruu = newUpdate(cmd); cmd.setResult(ruu.update(walk)); break; @@ -329,6 +326,8 @@ public class BatchRefUpdate { } catch (IOException err) { cmd.setResult(REJECTED_OTHER_REASON, MessageFormat.format( JGitText.get().lockError, err.getMessage())); + } finally { + monitor.update(1); } } } |