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>
This commit is contained in:
Shawn O. Pearce 2011-02-18 17:21:09 -08:00
parent 4275c4c1cf
commit 388ba7e005
1 changed files with 3 additions and 1 deletions

View File

@ -587,8 +587,10 @@ public void writePack(ProgressMonitor compressMonitor,
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);