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
This commit is contained in:
Shawn Pearce 2013-04-12 12:59:02 -07:00
parent a5c6aac76c
commit c9707e6353
1 changed files with 1 additions and 1 deletions

View File

@ -1996,7 +1996,7 @@ public void select(ObjectToPack otp, StoredObjectRepresentation next) {
otp.clearReuseAsIs();
}
otp.setDeltaAttempted(next.wasDeltaAttempted());
otp.setDeltaAttempted(reuseDeltas & next.wasDeltaAttempted());
otp.select(next);
}