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 /pack-bitmap.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 'pack-bitmap.c')
| -rw-r--r-- | pack-bitmap.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/pack-bitmap.c b/pack-bitmap.c index 15cf51166e..d14421ee20 100644 --- a/pack-bitmap.c +++ b/pack-bitmap.c @@ -683,13 +683,15 @@ static int open_pack_bitmap(struct repository *r, static int open_midx_bitmap(struct repository *r, struct bitmap_index *bitmap_git) { + struct odb_source *source; int ret = -1; - struct multi_pack_index *midx; assert(!bitmap_git->map); - for (midx = get_multi_pack_index(r); midx; midx = midx->next) { - if (!open_midx_bitmap_1(bitmap_git, midx)) + odb_prepare_alternates(r->objects); + for (source = r->objects->sources; source; source = source->next) { + struct multi_pack_index *midx = get_multi_pack_index(source); + if (midx && !open_midx_bitmap_1(bitmap_git, midx)) ret = 0; } return ret; @@ -3345,11 +3347,18 @@ static int verify_bitmap_file(const struct git_hash_algo *algop, int verify_bitmap_files(struct repository *r) { + struct odb_source *source; int res = 0; - for (struct multi_pack_index *m = get_multi_pack_index(r); - m; m = m->next) { - char *midx_bitmap_name = midx_bitmap_filename(m); + odb_prepare_alternates(r->objects); + for (source = r->objects->sources; source; source = source->next) { + struct multi_pack_index *m = get_multi_pack_index(source); + char *midx_bitmap_name; + + if (!m) + continue; + + midx_bitmap_name = midx_bitmap_filename(m); res |= verify_bitmap_file(r->hash_algo, midx_bitmap_name); free(midx_bitmap_name); } |
