Browse Source

Merge "PackWriter: Only search for base objects on thin packs"

stable-1.1
Shawn O. Pearce 13 years ago committed by Code Review
parent
commit
82e735c3aa
  1. 35
      org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/PackWriter.java

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

@ -1437,20 +1437,29 @@ public class PackWriter {
} }
commits = null; commits = null;
BaseSearch bases = new BaseSearch(countingMonitor, baseTrees, // if (thin && !baseTrees.isEmpty()) {
objectsMap, edgeObjects, reader); BaseSearch bases = new BaseSearch(countingMonitor, baseTrees, //
RevObject o; objectsMap, edgeObjects, reader);
while ((o = walker.nextObject()) != null) { RevObject o;
if (o.has(RevFlag.UNINTERESTING)) while ((o = walker.nextObject()) != null) {
continue; if (o.has(RevFlag.UNINTERESTING))
continue;
int pathHash = walker.getPathHashCode();
byte[] pathBuf = walker.getPathBuffer();
int pathLen = walker.getPathLength();
bases.addBase(o.getType(), pathBuf, pathLen, pathHash); int pathHash = walker.getPathHashCode();
addObject(o, pathHash); byte[] pathBuf = walker.getPathBuffer();
countingMonitor.update(1); int pathLen = walker.getPathLength();
bases.addBase(o.getType(), pathBuf, pathLen, pathHash);
addObject(o, pathHash);
countingMonitor.update(1);
}
} else {
RevObject o;
while ((o = walker.nextObject()) != null) {
if (o.has(RevFlag.UNINTERESTING))
continue;
addObject(o, walker.getPathHashCode());
countingMonitor.update(1);
}
} }
for (CachedPack pack : cachedPacks) for (CachedPack pack : cachedPacks)

Loading…
Cancel
Save