summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShawn Pearce <spearce@spearce.org>2013-04-12 12:59:02 -0700
committerShawn Pearce <spearce@spearce.org>2013-04-12 12:59:02 -0700
commitc9707e6353617f86cc75a7692797e1ed45e47cd3 (patch)
tree10e66d8713da830dead570abfa65c6aae966b131
parenta5c6aac76c6f5fa19e4582bef60417647faeccf8 (diff)
downloadjgit-c9707e6353617f86cc75a7692797e1ed45e47cd3.tar.gz
jgit-c9707e6353617f86cc75a7692797e1ed45e47cd3.zip
Always attempt delta compression when reuseDeltas is false
If reuseObjects=true but reuseDeltas=false the caller wants attempt a delta for every object in the input list. Test for reuseDeltas to ensure every object passes through the searchInWindow() method. If no delta is possible for an object and it will be stored whole (non-delta format), PackWriter may still reuse its content from any source pack. This avoids an inflate()-deflate() cycle to recompress the object contents. Change-Id: I845caeded419ef4551ef1c85787dd5ffd73235d9
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackWriter.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackWriter.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackWriter.java
index 2e6812c1c7..54a5826c01 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackWriter.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackWriter.java
@@ -1996,7 +1996,7 @@ public class PackWriter {
otp.clearReuseAsIs();
}
- otp.setDeltaAttempted(next.wasDeltaAttempted());
+ otp.setDeltaAttempted(reuseDeltas & next.wasDeltaAttempted());
otp.select(next);
}