summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit
diff options
context:
space:
mode:
authorIvan Frade <ifrade@google.com>2023-11-16 10:46:07 -0800
committerIvan Frade <ifrade@google.com>2023-11-16 14:37:24 -0800
commit4d82d0aa1f45e8bdf09c1a4990a7edb2a29a3a4d (patch)
tree4cdde11780f9e3f039fcd5ac8513513f1bd70847 /org.eclipse.jgit
parent4b5e9928342585f80d95136ac4ab0161841044d5 (diff)
downloadjgit-4d82d0aa1f45e8bdf09c1a4990a7edb2a29a3a4d.tar.gz
jgit-4d82d0aa1f45e8bdf09c1a4990a7edb2a29a3a4d.zip
BitmapWalkListener: Add method and rename for commits
During the walk, the commit can be either 1. already in the walk bitmap 2. unvisited so far with bitmap in the bitmap index 3. unvisited so far without bitmap in the bitmap index Expose these three states in the interface. This makes the interface easier to explain: it reports the commits found during the walk. As it is all about commits, rename the methods to onCommit***. Change-Id: I661f303eb22d3e735b0e439f16df7ace612376d9
Diffstat (limited to 'org.eclipse.jgit')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/revwalk/BitmapWalker.java30
1 files changed, 20 insertions, 10 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/BitmapWalker.java b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/BitmapWalker.java
index 5060823571..2218462426 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/BitmapWalker.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/BitmapWalker.java
@@ -48,29 +48,39 @@ public final class BitmapWalker {
private Bitmap prevBitmap;
/**
- * Report events happening during the walk.
+ * Report commits found during the walk
*
* @since 6.8
*/
public interface BitmapWalkListener {
+ /**
+ * The commit is already in the walk bitmap
+ *
+ * @param oid
+ * objectId of the commit already in bitmap
+ */
+ default void onCommitInBitmap(ObjectId oid) {
+ // Nothing to do
+ }
/**
- * The object is in the walk, and it has a bitmap
+ * The commit has a bitmap in the bitmap index
*
* @param oid
- * objectId with a bitmap in the bitmap index
+ * objectId of the commit with a bitmap in the bitmap index
*/
- default void onBitmapFound(ObjectId oid) {
+ default void onCommitWithBitmap(ObjectId oid) {
// Nothing to do
}
/**
- * The object is in the walk but doesn't have bitmap
+ * The commit doesn't have bitmap
*
* @param oid
- * objectId without a bitmap in the bitmap index
+ * objectId of the commit without a bitmap in the bitmap
+ * index
*/
- default void onBitmapNotFound(ObjectId oid) {
+ default void onCommitWithoutBitmap(ObjectId oid) {
// Nothing to do
}
}
@@ -195,7 +205,7 @@ public final class BitmapWalker {
Bitmap bitmap = bitmapIndex.getBitmap(obj);
if (bitmap != null) {
result.or(bitmap);
- listener.onBitmapFound(obj);
+ listener.onCommitWithBitmap(obj);
}
}
@@ -236,7 +246,7 @@ public final class BitmapWalker {
Bitmap bitmap = bitmapIndex.getBitmap(obj);
if (bitmap != null) {
bitmapResult.or(bitmap);
- listener.onBitmapFound(obj);
+ listener.onCommitWithBitmap(obj);
}
}
@@ -279,7 +289,7 @@ public final class BitmapWalker {
// of bitmaps.
pm.update(1);
countOfBitmapIndexMisses++;
- listener.onBitmapNotFound(oid);
+ listener.onCommitWithoutBitmap(oid);
}
RevObject ro;