Browse Source

Fix gc's usage of progress monitor

Change-Id: I8dcdf0b83e91e6132dc490e8ec53818220773c94
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
stable-2.1
Matthias Sohn 12 years ago
parent
commit
29d9fc478c
  1. 5
      org.eclipse.jgit/src/org/eclipse/jgit/storage/file/GC.java

5
org.eclipse.jgit/src/org/eclipse/jgit/storage/file/GC.java

@ -137,6 +137,7 @@ public class GC {
* @throws IOException * @throws IOException
*/ */
public Collection<PackFile> gc() throws IOException { public Collection<PackFile> gc() throws IOException {
pm.start(6 /* tasks */);
packRefs(); packRefs();
// TODO: implement reflog_expire(pm, repo); // TODO: implement reflog_expire(pm, repo);
Collection<PackFile> newPacks = repack(); Collection<PackFile> newPacks = repack();
@ -262,6 +263,7 @@ public class GC {
if (fanout != null && fanout.length > 0) { if (fanout != null && fanout.length > 0) {
pm.beginTask(JGitText.get().pruneLooseUnreferencedObjects, pm.beginTask(JGitText.get().pruneLooseUnreferencedObjects,
fanout.length); fanout.length);
try {
for (String d : fanout) { for (String d : fanout) {
pm.update(1); pm.update(1);
if (d.length() != 2) if (d.length() != 2)
@ -291,6 +293,9 @@ public class GC {
} }
} }
} }
} finally {
pm.endTask();
}
} }
if (deletionCandidates.isEmpty()) if (deletionCandidates.isEmpty())
return; return;

Loading…
Cancel
Save