summaryrefslogtreecommitdiff
path: root/pack-bitmap.c
diff options
context:
space:
mode:
authorTaylor Blau <me@ttaylorr.com>2021-01-13 22:24:00 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-01-14 05:53:46 (GMT)
commita78a90324d1c5ccba2ab46cb70573518dd6eeade (patch)
tree541ee2d79cd56c952d6ddd52b834a04a0e1526a8 /pack-bitmap.c
parentcf98f2e8e09416b72bf984af4706c140de8794ab (diff)
downloadgit-a78a90324d1c5ccba2ab46cb70573518dd6eeade.zip
git-a78a90324d1c5ccba2ab46cb70573518dd6eeade.tar.gz
git-a78a90324d1c5ccba2ab46cb70573518dd6eeade.tar.bz2
get_size_by_pos(): convert to new revindex API
Remove another caller that holds onto a 'struct revindex_entry' by replacing the direct indexing with calls to 'pack_pos_to_offset()' and 'pack_pos_to_index()'. Signed-off-by: Taylor Blau <me@ttaylorr.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'pack-bitmap.c')
-rw-r--r--pack-bitmap.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/pack-bitmap.c b/pack-bitmap.c
index 27a7a8a..89a528a 100644
--- a/pack-bitmap.c
+++ b/pack-bitmap.c
@@ -835,11 +835,11 @@ static unsigned long get_size_by_pos(struct bitmap_index *bitmap_git,
oi.sizep = &size;
if (pos < pack->num_objects) {
- struct revindex_entry *entry = &pack->revindex[pos];
- if (packed_object_info(the_repository, pack,
- entry->offset, &oi) < 0) {
+ off_t ofs = pack_pos_to_offset(pack, pos);
+ if (packed_object_info(the_repository, pack, ofs, &oi) < 0) {
struct object_id oid;
- nth_packed_object_id(&oid, pack, entry->nr);
+ nth_packed_object_id(&oid, pack,
+ pack_pos_to_index(pack, pos));
die(_("unable to get size of %s"), oid_to_hex(&oid));
}
} else {