PackWriter.Statistics stats = pw.getStatistics();
pack.setPackStats(stats);
- pack.setFileSize(PACK, stats.getTotalBytes());
- pack.setObjectCount(stats.getTotalObjects());
- pack.setDeltaCount(stats.getTotalDeltas());
objectsPacked += stats.getTotalObjects();
newPackStats.add(stats);
pm.endTask();
}
- private void writePack(DfsObjDatabase objdb, DfsPackDescription pack,
+ private static void writePack(DfsObjDatabase objdb,
+ DfsPackDescription pack,
PackWriter pw, ProgressMonitor pm) throws IOException {
DfsOutputStream out = objdb.writeFile(pack, PACK);
try {
- CountingOutputStream cnt = new CountingOutputStream(out);
- pw.writePack(pm, pm, cnt);
- pack.setObjectCount(pw.getObjectCount());
- pack.setFileSize(PACK, cnt.getCount());
+ pw.writePack(pm, pm, out);
} finally {
out.close();
}
}
- private void writeIndex(DfsObjDatabase objdb, DfsPackDescription pack,
+ private static void writeIndex(DfsObjDatabase objdb,
+ DfsPackDescription pack,
PackWriter pw) throws IOException {
DfsOutputStream out = objdb.writeFile(pack, INDEX);
try {
package org.eclipse.jgit.storage.dfs;
+import static org.eclipse.jgit.storage.pack.PackExt.PACK;
+
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
DfsPackDescription setPackStats(PackWriter.Statistics stats) {
this.stats = stats;
+ setFileSize(PACK, stats.getTotalBytes());
+ setObjectCount(stats.getTotalObjects());
+ setDeltaCount(stats.getTotalDeltas());
return this;
}