]> git.ipfire.org Git - thirdparty/git.git/commit
odb: add `source` field to struct object_info_source
authorPatrick Steinhardt <ps@pks.im>
Thu, 2 Jul 2026 12:02:01 +0000 (14:02 +0200)
committerJunio C Hamano <gitster@pobox.com>
Thu, 2 Jul 2026 16:52:32 +0000 (09:52 -0700)
commit32a95be604e710d38e05d0013fbb2a64257c4014
tree4b2960834d97eb5639d625d804e177d2371afb61
parent126076b62f5164f9da6bbe454fc71c164ea5cb42
odb: add `source` field to struct object_info_source

The previous commit introduced `struct object_info_source` as an opt-in
container for backend-specific information, but for now we only moved
preexisting data into this structure. Most importantly, the caller has
no way yet to learn about which source an object was actually looked up
from. Instead, callers have to rely on the `whence` enum to distinguish
the object type, but cannot use that enum to tell the object source.

Add a `struct odb_source *source` field to the structure and populate it
from each backend's lookup path.

The `whence` enum is still set and used by callers; it will be removed
in a subsequent commit now that `sourcep->source` can identify the
backend on its own.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/cat-file.c
builtin/index-pack.c
builtin/pack-objects.c
odb.c
odb.h
odb/source-inmemory.c
odb/source-loose.c
packfile.c
reachable.c