summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Taylor Blau <me@ttaylorr.com>2021-01-13 17:23:56 -0500
committerLibravatar Junio C Hamano <gitster@pobox.com>2021-01-13 21:53:46 -0800
commitcf98f2e8e09416b72bf984af4706c140de8794ab (patch)
treeab1fa8b383f7b8df10629fc45ecb4c20c3201028
parentbitmap_position_packfile(): convert to new revindex API (diff)
downloadtgif-cf98f2e8e09416b72bf984af4706c140de8794ab.tar.xz
show_objects_for_type(): convert to new revindex API
Avoid storing the revindex entry directly, since this structure will soon be removed from the public interface. Instead, store the offset and index position by calling 'pack_pos_to_offset()' and 'pack_pos_to_index()', respectively. Signed-off-by: Taylor Blau <me@ttaylorr.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--pack-bitmap.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/pack-bitmap.c b/pack-bitmap.c
index d6861ddd4d..27a7a8ac4c 100644
--- a/pack-bitmap.c
+++ b/pack-bitmap.c
@@ -711,21 +711,22 @@ static void show_objects_for_type(
for (offset = 0; offset < BITS_IN_EWORD; ++offset) {
struct object_id oid;
- struct revindex_entry *entry;
- uint32_t hash = 0;
+ uint32_t hash = 0, index_pos;
+ off_t ofs;
if ((word >> offset) == 0)
break;
offset += ewah_bit_ctz64(word >> offset);
- entry = &bitmap_git->pack->revindex[pos + offset];
- nth_packed_object_id(&oid, bitmap_git->pack, entry->nr);
+ index_pos = pack_pos_to_index(bitmap_git->pack, pos + offset);
+ ofs = pack_pos_to_offset(bitmap_git->pack, pos + offset);
+ nth_packed_object_id(&oid, bitmap_git->pack, index_pos);
if (bitmap_git->hashes)
- hash = get_be32(bitmap_git->hashes + entry->nr);
+ hash = get_be32(bitmap_git->hashes + index_pos);
- show_reach(&oid, object_type, 0, hash, bitmap_git->pack, entry->offset);
+ show_reach(&oid, object_type, 0, hash, bitmap_git->pack, ofs);
}
}
}