]> source.dussan.org Git - jgit.git/commitdiff
PackWriter: Correct total delta count when reusing pack 38/2538/1
authorShawn O. Pearce <spearce@spearce.org>
Sat, 19 Feb 2011 01:21:09 +0000 (17:21 -0800)
committerShawn O. Pearce <spearce@spearce.org>
Sat, 19 Feb 2011 01:36:45 +0000 (17:36 -0800)
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>
org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/PackWriter.java

index f74f2628e6d0ce945dfc32b679885a04b70b94e4..285cd7e21a0930867f7a1918faf509c0ce4e18b1 100644 (file)
@@ -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);