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>
This commit is contained in:

committed by
Junio C Hamano

parent
cf98f2e8e0
commit
a78a90324d
@ -835,11 +835,11 @@ static unsigned long get_size_by_pos(struct bitmap_index *bitmap_git,
|
|||||||
oi.sizep = &size;
|
oi.sizep = &size;
|
||||||
|
|
||||||
if (pos < pack->num_objects) {
|
if (pos < pack->num_objects) {
|
||||||
struct revindex_entry *entry = &pack->revindex[pos];
|
off_t ofs = pack_pos_to_offset(pack, pos);
|
||||||
if (packed_object_info(the_repository, pack,
|
if (packed_object_info(the_repository, pack, ofs, &oi) < 0) {
|
||||||
entry->offset, &oi) < 0) {
|
|
||||||
struct object_id oid;
|
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));
|
die(_("unable to get size of %s"), oid_to_hex(&oid));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user