diff options
| author | Patrick Steinhardt <ps@pks.im> | 2025-07-15 13:29:23 +0200 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-07-15 12:07:30 -0700 |
| commit | c620586fccf5a62e36a2d6cc96d0427f93f123fc (patch) | |
| tree | e4a75f63122827372b1709f9c422e2ce92cd7afa | |
| parent | 7fc19983926af6aea1eb393a5deb7bb2fc3cd495 (diff) | |
| download | git-c620586fccf5a62e36a2d6cc96d0427f93f123fc.tar.gz | |
packfile: stop using linked MIDX list in `get_all_packs()`
Refactor `get_all_packs()` so that we stop using the linked list of
multi-pack indices. Note that there is no need to explicitly prepare
alternates, and neither do we have to use `get_multi_pack_index()`,
because `prepare_packed_git()` already takes care of populating all data
structures for us.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
| -rw-r--r-- | packfile.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/packfile.c b/packfile.c index 2d19c53ea9..ff33692f4b 100644 --- a/packfile.c +++ b/packfile.c @@ -1086,12 +1086,13 @@ struct multi_pack_index *get_multi_pack_index(struct odb_source *source) struct packed_git *get_all_packs(struct repository *r) { - struct multi_pack_index *m; - prepare_packed_git(r); - for (m = r->objects->multi_pack_index; m; m = m->next) { - uint32_t i; - for (i = 0; i < m->num_packs + m->num_packs_in_base; i++) + + for (struct odb_source *source = r->objects->sources; source; source = source->next) { + struct multi_pack_index *m = source->midx; + if (!m) + continue; + for (uint32_t i = 0; i < m->num_packs + m->num_packs_in_base; i++) prepare_midx_pack(r, m, i); } |
