Browse Source

Convert remaining callers of BitmapBuilder.add to use .addObject

When setupTipCommitBitmaps is called, writeBitmaps does not have any
bitmaps saved, so these calls to .add always add a single commit and
do not OR in a bitmap.

The objects returned by nextObject after a commit walk is finished
are trees and blobs.  Non-commit objects do not have bitmaps
associated so the call to .add also can only add a single object.

Change-Id: I7b816145251a7fa4f1fffe0d03644257ea7f5440
stable-4.2
Jonathan Nieder 9 years ago
parent
commit
af4ee73454
  1. 4
      org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackWriterBitmapPreparer.java
  2. 2
      org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackWriterBitmapWalker.java

4
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackWriterBitmapPreparer.java

@ -410,7 +410,7 @@ class PackWriterBitmapPreparer {
BitmapBuilder bitmap = commitBitmapIndex.newBitmapBuilder(); BitmapBuilder bitmap = commitBitmapIndex.newBitmapBuilder();
bitmap.or(reuse); bitmap.or(reuse);
bitmap.add(rc, Constants.OBJ_COMMIT); bitmap.addObject(rc, Constants.OBJ_COMMIT);
tipCommitBitmaps.add(new BitmapBuilderEntry(rc, bitmap)); tipCommitBitmaps.add(new BitmapBuilderEntry(rc, bitmap));
} }
@ -429,7 +429,7 @@ class PackWriterBitmapPreparer {
continue; continue;
} }
for (RevCommit c : rc.getParents()) { for (RevCommit c : rc.getParents()) {
bitmap.add(c, Constants.OBJ_COMMIT); bitmap.addObject(c, Constants.OBJ_COMMIT);
} }
} }
pm.update(1); pm.update(1);

2
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackWriterBitmapWalker.java

@ -129,7 +129,7 @@ final class PackWriterBitmapWalker {
RevObject ro; RevObject ro;
while ((ro = walker.nextObject()) != null) { while ((ro = walker.nextObject()) != null) {
bitmapResult.add(ro, ro.getType()); bitmapResult.addObject(ro, ro.getType());
pm.update(1); pm.update(1);
} }
} }

Loading…
Cancel
Save