Skip to content

Commit db17e77

Browse files
ttaylorrgitster
authored andcommitted
pack-bitmap.c: compute disk-usage with incremental MIDXs
In a similar fashion as previous commits, use nth_midxed_pack() instead of accessing the MIDX's ->packs array directly to support incremental MIDXs. Signed-off-by: Taylor Blau <[email protected]> Acked-by: Elijah Newren <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent faab03f commit db17e77

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pack-bitmap.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1779,7 +1779,7 @@ static unsigned long get_size_by_pos(struct bitmap_index *bitmap_git,
17791779
uint32_t midx_pos = pack_pos_to_midx(bitmap_git->midx, pos);
17801780
uint32_t pack_id = nth_midxed_pack_int_id(bitmap_git->midx, midx_pos);
17811781

1782-
pack = bitmap_git->midx->packs[pack_id];
1782+
pack = nth_midxed_pack(bitmap_git->midx, pack_id);
17831783
ofs = nth_midxed_offset(bitmap_git->midx, midx_pos);
17841784
} else {
17851785
pack = bitmap_git->pack;
@@ -3049,7 +3049,7 @@ static off_t get_disk_usage_for_type(struct bitmap_index *bitmap_git,
30493049
off_t offset = nth_midxed_offset(bitmap_git->midx, midx_pos);
30503050

30513051
uint32_t pack_id = nth_midxed_pack_int_id(bitmap_git->midx, midx_pos);
3052-
struct packed_git *pack = bitmap_git->midx->packs[pack_id];
3052+
struct packed_git *pack = nth_midxed_pack(bitmap_git->midx, pack_id);
30533053

30543054
if (offset_to_pack_pos(pack, offset, &pack_pos) < 0) {
30553055
struct object_id oid;

0 commit comments

Comments
 (0)