]> Kevux Git Server - rit/commit
odb: introduce parent pointers
authorPatrick Steinhardt <ps@pks.im>
Tue, 1 Jul 2025 12:22:16 +0000 (14:22 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 1 Jul 2025 21:46:34 +0000 (14:46 -0700)
commit2f5181fce6c6353f9c743d9d396fbf06527688c7
tree880b635c93217573fa3b33799ae1870e059d88fd
parent8f49151763cb81adf4bcec53c1ae67057081b02d
odb: introduce parent pointers

In subsequent commits we'll get rid of our use of `the_repository` in
"odb.c" in favor of explicitly passing in a `struct object_database` or
a `struct odb_source`. In some cases though we'll need access to the
repository, for example to read a config value from it, but we don't
have a way to access the repository owning a specific object database.

Introduce parent pointers for `struct object_database` to its owning
repository as well as for `struct odb_source` to its owning object
database, which will allow us to adapt those use cases.

Note that this change requires us to pass through the object database to
`link_alt_odb_entry()` so that we can set up the parent pointers for any
source there. The callchain is adapted to pass through the object
database accordingly.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
odb.c
odb.h
repository.c