Browse Source

PackWriter: Correct total delta count when reusing pack

If the CachedPack knows its delta count, we need to increment both
the totalDeltas and reusedDeltas fields of the stats object.

Change-Id: I70113609c22476ce7f1e4d9a92f486e9b0f59e44
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
stable-0.12
Shawn O. Pearce 14 years ago
parent
commit
388ba7e005
  1. 4
      org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/PackWriter.java

4
org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/PackWriter.java

@ -587,8 +587,10 @@ public class PackWriter {
stats.thinPackBytes = out.length() - (headerEnd - headerStart);
for (CachedPack pack : cachedPacks) {
long deltaCnt = pack.getDeltaCount();
stats.reusedObjects += pack.getObjectCount();
stats.reusedDeltas += pack.getDeltaCount();
stats.reusedDeltas += deltaCnt;
stats.totalDeltas += deltaCnt;
reuseSupport.copyPackAsIs(out, pack);
}
writeChecksum(out);

Loading…
Cancel
Save