summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIvan Frade <ifrade@google.com>2024-04-12 16:05:14 +0000
committerGerrit Code Review <support@gerrithub.io>2024-04-12 16:05:14 +0000
commit5c1c006307cac302b07d42ed3172a3cb3e630dcc (patch)
tree9093436c5c2d19094e479384f588d0b38023efa7
parentb6ff6ead57621a6621a1d826636d3366e55b23f7 (diff)
parent1790ff518bf786de8e4ced6fc9dd59d026c9ea77 (diff)
downloadjgit-5c1c006307cac302b07d42ed3172a3cb3e630dcc.tar.gz
jgit-5c1c006307cac302b07d42ed3172a3cb3e630dcc.zip
Merge "PackBitmapIndexBuilder.StoredEntry: add getter for objectId"
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackBitmapIndexBuilder.java20
1 files changed, 16 insertions, 4 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackBitmapIndexBuilder.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackBitmapIndexBuilder.java
index 7646c1909b..1da805503d 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackBitmapIndexBuilder.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackBitmapIndexBuilder.java
@@ -191,8 +191,8 @@ public class PackBitmapIndexBuilder extends BasePackBitmapIndex {
throw new IllegalStateException();
}
bestBitmap.trim();
- StoredEntry result = new StoredEntry(entry.idxPosition, bestBitmap,
- bestXorOffset, bitmapToWrite.getFlags());
+ StoredEntry result = new StoredEntry(entry, entry.idxPosition,
+ bestBitmap, bestXorOffset, bitmapToWrite.getFlags());
return result;
}
@@ -330,6 +330,8 @@ public class PackBitmapIndexBuilder extends BasePackBitmapIndex {
/** Data object for the on disk representation of a bitmap entry. */
public static final class StoredEntry {
+ private final ObjectId objectId;
+
private final long idxPosition;
private final EWAHCompressedBitmap bitmap;
@@ -341,6 +343,8 @@ public class PackBitmapIndexBuilder extends BasePackBitmapIndex {
/**
* Create a StoredEntry
*
+ * @param objectId
+ * objectId of the object associated with the bitmap
* @param idxPosition
* position of this object into the pack index (i.e. sorted
* by sha1)
@@ -353,8 +357,9 @@ public class PackBitmapIndexBuilder extends BasePackBitmapIndex {
* @param flags
* flags for this bitmap
*/
- public StoredEntry(long idxPosition, EWAHCompressedBitmap bitmap,
- int xorOffset, int flags) {
+ public StoredEntry(ObjectId objectId, long idxPosition,
+ EWAHCompressedBitmap bitmap, int xorOffset, int flags) {
+ this.objectId = objectId;
this.idxPosition = idxPosition;
this.bitmap = bitmap;
this.xorOffset = xorOffset;
@@ -395,6 +400,13 @@ public class PackBitmapIndexBuilder extends BasePackBitmapIndex {
public long getIdxPosition() {
return idxPosition;
}
+
+ /**
+ * @return the objectId of the object associated with this bitmap
+ */
+ public ObjectId getObjectId() {
+ return objectId;
+ }
}
private static final class PositionEntry extends ObjectIdOwnerMap.Entry {