Browse Source

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
stable-3.0
Shawn Pearce 12 years ago
parent
commit
c9707e6353
  1. 2
      org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackWriter.java

2
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);
}

Loading…
Cancel
Save