aboutsummaryrefslogtreecommitdiff
path: root/odb.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2025-07-01 14:22:17 +0200
committerJunio C Hamano <gitster@pobox.com>2025-07-01 14:46:35 -0700
commitbd52ea343d2af91574fedcf765250f44f3d624d4 (patch)
treebece7d934b61e20a4641262a7f45c7e39e860a44 /odb.c
parent2f5181fce6c6353f9c743d9d396fbf06527688c7 (diff)
downloadgit-bd52ea343d2af91574fedcf765250f44f3d624d4.tar.xz
odb: get rid of `the_repository` in `find_odb()`
Get rid of our dependency on `the_repository` in `find_odb()` by passing in the object database in which we want to search for the source and adjusting all callers. Rename the function to `odb_find_source()`. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'odb.c')
-rw-r--r--odb.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/odb.c b/odb.c
index 0464d7f54a..240fc62ca2 100644
--- a/odb.c
+++ b/odb.c
@@ -448,14 +448,14 @@ out:
return ref_git;
}
-struct odb_source *find_odb(struct repository *r, const char *obj_dir)
+struct odb_source *odb_find_source(struct object_database *odb, const char *obj_dir)
{
struct odb_source *source;
char *obj_dir_real = real_pathdup(obj_dir, 1);
struct strbuf odb_path_real = STRBUF_INIT;
- prepare_alt_odb(r);
- for (source = r->objects->sources; source; source = source->next) {
+ prepare_alt_odb(odb->repo);
+ for (source = odb->sources; source; source = source->next) {
strbuf_realpath(&odb_path_real, source->path, 1);
if (!strcmp(obj_dir_real, odb_path_real.buf))
break;