diff options
| author | Taylor Blau <me@ttaylorr.com> | 2025-03-20 13:56:49 -0400 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-03-21 04:33:57 -0700 |
| commit | db17e777c884b9aa2ba532a96a5439e9be09174b (patch) | |
| tree | 9c93ce40bf9e38c278b65b9e4af1d4aeca2a1420 /pack-bitmap.c | |
| parent | faab03f9a16cbca85415b73504eb95e6b8ed3d6b (diff) | |
| download | git-db17e777c884b9aa2ba532a96a5439e9be09174b.tar.xz | |
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 <me@ttaylorr.com>
Acked-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'pack-bitmap.c')
| -rw-r--r-- | pack-bitmap.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pack-bitmap.c b/pack-bitmap.c index 65ad631ce1..4086277de8 100644 --- a/pack-bitmap.c +++ b/pack-bitmap.c @@ -1779,7 +1779,7 @@ static unsigned long get_size_by_pos(struct bitmap_index *bitmap_git, uint32_t midx_pos = pack_pos_to_midx(bitmap_git->midx, pos); uint32_t pack_id = nth_midxed_pack_int_id(bitmap_git->midx, midx_pos); - pack = bitmap_git->midx->packs[pack_id]; + pack = nth_midxed_pack(bitmap_git->midx, pack_id); ofs = nth_midxed_offset(bitmap_git->midx, midx_pos); } else { pack = bitmap_git->pack; @@ -3049,7 +3049,7 @@ static off_t get_disk_usage_for_type(struct bitmap_index *bitmap_git, off_t offset = nth_midxed_offset(bitmap_git->midx, midx_pos); uint32_t pack_id = nth_midxed_pack_int_id(bitmap_git->midx, midx_pos); - struct packed_git *pack = bitmap_git->midx->packs[pack_id]; + struct packed_git *pack = nth_midxed_pack(bitmap_git->midx, pack_id); if (offset_to_pack_pos(pack, offset, &pack_pos) < 0) { struct object_id oid; |
