summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsPackCompactor.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsPackCompactor.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsPackCompactor.java
index ea563926b2..83728842b7 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsPackCompactor.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsPackCompactor.java
@@ -220,8 +220,14 @@ public class DfsPackCompactor {
pw.setReuseDeltaCommits(false);
addObjectsToPack(pw, ctx, pm);
- if (pw.getObjectCount() == 0)
+ if (pw.getObjectCount() == 0) {
+ List<DfsPackDescription> remove = toPrune();
+ if (remove.size() > 0)
+ objdb.commitPack(
+ Collections.<DfsPackDescription>emptyList(),
+ remove);
return;
+ }
boolean rollback = true;
DfsPackDescription pack = objdb.newPack(COMPACT);