diff options
| author | Patrick Steinhardt <ps@pks.im> | 2026-03-05 15:19:42 +0100 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2026-03-05 11:45:14 -0800 |
| commit | cb506a8a69c953f7b87bb3ae099e0bed8218d3ab (patch) | |
| tree | 2b469f6c020f5fc1889a01754ed99443085eeb61 /builtin/pack-objects.c | |
| parent | ba1c21d34346e5979f9308806274bfcda4949ad4 (diff) | |
| download | git-cb506a8a69c953f7b87bb3ae099e0bed8218d3ab.tar.xz | |
odb: introduce "files" source
Introduce a new "files" object database source. This source encapsulates
access to both loose object files and the packfile store, similar to how
the "files" backend for refs encapsulates access to loose refs and the
packed-refs file.
Note that for now the "files" source is still a direct member of a
`struct odb_source`. This architecture will be reversed in the next
commit so that the files source contains a `struct odb_source`.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/pack-objects.c')
| -rw-r--r-- | builtin/pack-objects.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c index 242d1c68f0..0c3c01cdc9 100644 --- a/builtin/pack-objects.c +++ b/builtin/pack-objects.c @@ -1531,7 +1531,7 @@ static int want_cruft_object_mtime(struct repository *r, struct odb_source *source; for (source = r->objects->sources; source; source = source->next) { - struct packed_git **cache = packfile_store_get_kept_pack_cache(source->packfiles, flags); + struct packed_git **cache = packfile_store_get_kept_pack_cache(source->files->packed, flags); for (; *cache; cache++) { struct packed_git *p = *cache; @@ -1753,11 +1753,11 @@ static int want_object_in_pack_mtime(const struct object_id *oid, } for (source = the_repository->objects->sources; source; source = source->next) { - for (e = source->packfiles->packs.head; e; e = e->next) { + for (e = source->files->packed->packs.head; e; e = e->next) { struct packed_git *p = e->pack; want = want_object_in_pack_one(p, oid, exclude, found_pack, found_offset, found_mtime); if (!exclude && want > 0) - packfile_list_prepend(&source->packfiles->packs, p); + packfile_list_prepend(&source->files->packed->packs, p); if (want != -1) return want; } @@ -4340,7 +4340,7 @@ static void add_objects_in_unpacked_packs(void) if (!source->local) continue; - if (packfile_store_for_each_object(source->packfiles, &oi, + if (packfile_store_for_each_object(source->files->packed, &oi, add_object_in_unpacked_pack, NULL, ODB_FOR_EACH_OBJECT_PACK_ORDER | ODB_FOR_EACH_OBJECT_LOCAL_ONLY | |
