aboutsummaryrefslogtreecommitdiffstats
path: root/midx.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2025-08-11 15:46:41 +0200
committerJunio C Hamano <gitster@pobox.com>2025-08-11 09:22:21 -0700
commit595bef7180b57889a4dec4b675a7fc6084c863ac (patch)
tree7cf77d6fbd1702de05798d40f8d15562ab61495b /midx.c
parent70b7b03f986f5aa43d56e7bbf1fee149d790d06f (diff)
downloadgit-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 'midx.c')
-rw-r--r--midx.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/midx.c b/midx.c
index 7d407682e6..b9ca0915a6 100644
--- a/midx.c
+++ b/midx.c
@@ -723,7 +723,7 @@ int midx_preferred_pack(struct multi_pack_index *m, uint32_t *pack_int_id)
return 0;
}
-int prepare_multi_pack_index_one(struct odb_source *source, int local)
+int prepare_multi_pack_index_one(struct odb_source *source)
{
struct repository *r = source->odb->repo;
@@ -734,7 +734,8 @@ int prepare_multi_pack_index_one(struct odb_source *source, int local)
if (source->midx)
return 1;
- source->midx = load_multi_pack_index(r, source->path, local);
+ source->midx = load_multi_pack_index(r, source->path,
+ source->local);
return !!source->midx;
}