]> git.ipfire.org Git - thirdparty/git.git/commit
midx-write.c: enumerate `pack_int_id` values directly
authorTaylor Blau <me@ttaylorr.com>
Wed, 14 Jan 2026 19:54:58 +0000 (14:54 -0500)
committerJunio C Hamano <gitster@pobox.com>
Wed, 14 Jan 2026 20:52:59 +0000 (12:52 -0800)
commit8145f2d4ffb0b3db22c2a8a1429d92daa6b0caed
tree8fafa02747c3fb363bbd686c36f8ec84969ff5a2
parente59b7b8756ce1f125391f4c862f73e243e1f086a
midx-write.c: enumerate `pack_int_id` values directly

Our `midx-write.c::fill_packs_from_midx()` function currently enumerates
the range [0, m->num_packs), and then shifts its index variable up by
`m->num_packs_in_base` to produce a valid `pack_int_id`.

Instead, directly enumerate the range:

    [m->num_packs_in_base, m->num_packs_in_base + m->num_packs)

, which are the original pack_int_ids themselves as opposed to the
indexes of those packs relative to the MIDX layer they are contained
within.

Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
midx-write.c