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
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackWriterBitmapPreparer.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackWriterBitmapPreparer.java
index 50693d3..509ee61 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackWriterBitmapPreparer.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackWriterBitmapPreparer.java
@@ -410,7 +410,7 @@ private CommitSelectionHelper setupTipCommitBitmaps(RevWalk rw,
BitmapBuilder bitmap = commitBitmapIndex.newBitmapBuilder();
bitmap.or(reuse);
- bitmap.add(rc, Constants.OBJ_COMMIT);
+ bitmap.addObject(rc, Constants.OBJ_COMMIT);
tipCommitBitmaps.add(new BitmapBuilderEntry(rc, bitmap));
}
@@ -429,7 +429,7 @@ private CommitSelectionHelper setupTipCommitBitmaps(RevWalk rw,
continue;
}
for (RevCommit c : rc.getParents()) {
- bitmap.add(c, Constants.OBJ_COMMIT);
+ bitmap.addObject(c, Constants.OBJ_COMMIT);
}
}
pm.update(1);
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackWriterBitmapWalker.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackWriterBitmapWalker.java
index 01aa932..262e5c4 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackWriterBitmapWalker.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackWriterBitmapWalker.java
@@ -129,7 +129,7 @@ BitmapBuilder findObjects(Set<? extends ObjectId> start, BitmapBuilder seen, boo
RevObject ro;
while ((ro = walker.nextObject()) != null) {
- bitmapResult.add(ro, ro.getType());
+ bitmapResult.addObject(ro, ro.getType());
pm.update(1);
}
}