diff options
| author | Junio C Hamano <gitster@pobox.com> | 2025-07-28 14:26:31 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-07-28 14:26:32 -0700 |
| commit | a6727995acaa7ed012de255cb79d84b51ee0eb0a (patch) | |
| tree | 2e48ed51ced769f3f15ae601b74083cb6fcc1843 /builtin/pack-objects.c | |
| parent | Merge branch 'kn/for-each-ref-skip' into next (diff) | |
| parent | midx: remove now-unused linked list of multi-pack indices (diff) | |
| download | git-a6727995acaa7ed012de255cb79d84b51ee0eb0a.tar.gz git-a6727995acaa7ed012de255cb79d84b51ee0eb0a.zip | |
Merge branch 'ps/object-store-midx' into next
Redefine where the multi-pack-index sits in the object subsystem,
which recently was restructured to allow multiple backends that
support a single object source that belongs to one repository. A
midx does span mulitple "object sources".
* ps/object-store-midx:
midx: remove now-unused linked list of multi-pack indices
packfile: stop using linked MIDX list in `get_all_packs()`
packfile: stop using linked MIDX list in `find_pack_entry()`
packfile: refactor `get_multi_pack_index()` to work on sources
midx: stop using linked list when closing MIDX
packfile: refactor `prepare_packed_git_one()` to work on sources
midx: start tracking per object database source
Diffstat (limited to 'builtin/pack-objects.c')
| -rw-r--r-- | builtin/pack-objects.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c index 067b9e322a..3dd84495b8 100644 --- a/builtin/pack-objects.c +++ b/builtin/pack-objects.c @@ -1706,8 +1706,8 @@ static int want_object_in_pack_mtime(const struct object_id *oid, uint32_t found_mtime) { int want; + struct odb_source *source; struct list_head *pos; - struct multi_pack_index *m; if (!exclude && local && has_loose_object_nonlocal(oid)) return 0; @@ -1727,9 +1727,13 @@ static int want_object_in_pack_mtime(const struct object_id *oid, *found_offset = 0; } - for (m = get_multi_pack_index(the_repository); m; m = m->next) { + odb_prepare_alternates(the_repository->objects); + + for (source = the_repository->objects->sources; source; source = source->next) { + struct multi_pack_index *m = get_multi_pack_index(source); struct pack_entry e; - if (fill_midx_entry(the_repository, oid, &e, m)) { + + if (m && fill_midx_entry(the_repository, oid, &e, m)) { want = want_object_in_pack_one(e.p, oid, exclude, found_pack, found_offset, found_mtime); if (want != -1) return want; |
