]> git.ipfire.org Git - thirdparty/git.git/commit
odb: store locality in object database sources
authorPatrick Steinhardt <ps@pks.im>
Mon, 11 Aug 2025 13:46:41 +0000 (15:46 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 11 Aug 2025 16:22:21 +0000 (09:22 -0700)
commit595bef7180b57889a4dec4b675a7fc6084c863ac
tree7cf77d6fbd1702de05798d40f8d15562ab61495b
parent70b7b03f986f5aa43d56e7bbf1fee149d790d06f
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>
midx.c
midx.h
odb.c
odb.h
packfile.c
repository.c