diff options
| author | Patrick Steinhardt <ps@pks.im> | 2025-08-11 15:46:41 +0200 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-08-11 09:22:21 -0700 |
| commit | 595bef7180b57889a4dec4b675a7fc6084c863ac (patch) | |
| tree | 7cf77d6fbd1702de05798d40f8d15562ab61495b /odb.h | |
| parent | 70b7b03f986f5aa43d56e7bbf1fee149d790d06f (diff) | |
| download | git-595bef7180b57889a4dec4b675a7fc6084c863ac.tar.gz | |
odb: store locality in object database sources
Object database sources are classified either as:
- Local, which means that the source is the repository's primary
source. This is typically ".git/objects".
- Non-local, which is everything else. Most importantly this includes
alternates and quarantine directories.
This locality is often computed ad-hoc by checking whether a given
object source is the first one. This works, but it is quite roundabout.
Refactor the code so that we store locality when creating the sources in
the first place. This makes it both more accessible and robust.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'odb.h')
| -rw-r--r-- | odb.h | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -64,6 +64,14 @@ struct odb_source { struct multi_pack_index *midx; /* + * Figure out whether this is the local source of the owning + * repository, which would typically be its ".git/objects" directory. + * This local object directory is usually where objects would be + * written to. + */ + bool local; + + /* * This is a temporary object store created by the tmp_objdir * facility. Disable ref updates since the objects in the store * might be discarded on rollback. |
