mirror of
https://github.com/git/git.git
synced 2025-12-12 20:36:24 +01:00
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>
This commit is contained in:
committed by
Junio C Hamano
parent
2f5181fce6
commit
bd52ea343d
6
odb.c
6
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;
|
||||
|
||||
Reference in New Issue
Block a user