]> git.ipfire.org Git - thirdparty/git.git/commit
packfile: refactor `get_multi_pack_index()` to work on sources
authorPatrick Steinhardt <ps@pks.im>
Tue, 15 Jul 2025 11:29:21 +0000 (13:29 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 15 Jul 2025 19:07:29 +0000 (12:07 -0700)
commit736bb725ebcd37d567455db2ac50524dea11223c
tree71e35b47700022912a7d0090bf578b28b9b7cf60
parent6567432ab4f93f63cd2111197c91651a9b04c517
packfile: refactor `get_multi_pack_index()` to work on sources

The function `get_multi_pack_index()` loads multi-pack indices via
`prepare_packed_git()` and then returns the linked list of multi-pack
indices that is stored in `struct object_database`. That list is in the
process of being removed though in favor of storing the MIDX as part of
the object database source it belongs to.

Refactor `get_multi_pack_index()` so that it returns the multi-pack
index for a single object source. Callers are now expected to call this
function for each source they are interested in. This requires them to
iterate through alternates, so we have to prepare alternate object
sources before doing so.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/pack-objects.c
builtin/repack.c
midx-write.c
object-name.c
pack-bitmap.c
packfile.c
packfile.h