]> source.dussan.org Git - jgit.git/commitdiff
Assume GC_REST and GC_TXN also attempted deltas during packing 88/90688/1
authorShawn Pearce <spearce@spearce.org>
Wed, 8 Feb 2017 23:34:00 +0000 (15:34 -0800)
committerShawn Pearce <spearce@spearce.org>
Wed, 8 Feb 2017 23:34:00 +0000 (15:34 -0800)
In a DFS repository the DfsGarbageCollector will typically attempt
delta compression while creating the three main pack files: GC,
GC_REST and GC_TXN. Include all of these in the wasDeltaAttempted()
decision so that future packers can bypass delta compression of
non-delta objects.

Change-Id: Ic2330c69fab0c494b920b4df0a290f3c2e1a03d7

org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsObjectRepresentation.java

index 7edae88110bbf15cc53cea9a9d65fe25ed2dc956..ddcfff60821bf750e74ea346208aef53f05f8467 100644 (file)
@@ -43,8 +43,6 @@
 
 package org.eclipse.jgit.internal.storage.dfs;
 
-import static org.eclipse.jgit.internal.storage.dfs.DfsObjDatabase.PackSource.GC;
-
 import org.eclipse.jgit.internal.storage.pack.StoredObjectRepresentation;
 import org.eclipse.jgit.lib.ObjectId;
 
@@ -76,6 +74,13 @@ class DfsObjectRepresentation extends StoredObjectRepresentation {
 
        @Override
        public boolean wasDeltaAttempted() {
-               return pack.getPackDescription().getPackSource() == GC;
+               switch (pack.getPackDescription().getPackSource()) {
+               case GC:
+               case GC_REST:
+               case GC_TXN:
+                       return true;
+               default:
+                       return false;
+               }
        }
 }