]> Kevux Git Server - rit/commit
odb/source-loose: store pointer to "files" instead of generic source
authorPatrick Steinhardt <ps@pks.im>
Mon, 1 Jun 2026 08:20:25 +0000 (10:20 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 1 Jun 2026 09:47:17 +0000 (18:47 +0900)
commit1d451ba6fec076d357abf62607b97f585283030a
tree753cf7c381b47c46554df68106794f1d9808622d
parent514f039c9052c23047c310f911ba8c0c2e74a1c7
odb/source-loose: store pointer to "files" instead of generic source

The `struct odb_source_loose` 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 "loose" source doesn't have any owning parent source at all
so that it can be used 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 "loose" 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.

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

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
object-file.c
odb/source-files.c
odb/source-loose.c
odb/source-loose.h