]> git.99rst.org Git - git.git/commit
odb/source-packed: store pointer to "files" instead of generic source
authorPatrick Steinhardt <redacted>
Wed, 17 Jun 2026 06:39:47 +0000 (08:39 +0200)
committerJunio C Hamano <redacted>
Wed, 17 Jun 2026 12:00:00 +0000 (05:00 -0700)
commit3ac21e6d825a642dcab826772b495f492148299c
tree51c1e8fd374b9376d35d64b122f39d59e649f129
parentc71a1214156374b7b8c3c9158aa27e94e70df6c9
odb/source-packed: store pointer to "files" instead of generic source

The `struct odb_source_packed` holds a pointer to its owning parent
source. The way that Git is currently structured, this parent is always
the "files" source. In subsequent commits we're going to detangle that
so that the "packed" source doesn't have any owning parent source at
all, which makes it usable as a completely standalone source.

Detangling this mess is somewhat intricate though, and is made even more
intricate because it's not always clear which kind of source one is
holding at a specific point in time -- either the parent "files" source,
or the child "packed" source.

Make this relationship more explicit by storing a pointer to the "files"
source instead of storing a pointer to a generic `struct odb_source`.
This will help make subsequent steps a bit clearer by making it more
obvious whether we're using the generic "base" source or the owning
"files" source.

Note that this is a temporary step, only. At the end of this series
we will have dropped the "files" pointer completely.

Signed-off-by: Patrick Steinhardt <redacted>
Signed-off-by: Junio C Hamano <redacted>
odb/source-files.c
odb/source-packed.c
odb/source-packed.h
packfile.c
git clone https://git.99rst.org/PROJECT