submodule-config: add repository argument to submodule_from_{name, path}
This enables submodule_from_{name, path} to handle arbitrary repositories. All callers just pass in the_repository, a later patch will pass in other repos. While at it remove the extern key word from the declarations. Reviewed-by: Jonathan Tan <jonathantanmy@google.com> Signed-off-by: Stefan Beller <sbeller@google.com> Reviewed-by: Jonathan Tan <jonathantanmy@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
f793b895fd
commit
3b8fb393bc
@ -619,18 +619,20 @@ static void gitmodules_read_check(struct repository *repo)
|
||||
repo_read_gitmodules(repo);
|
||||
}
|
||||
|
||||
const struct submodule *submodule_from_name(const struct object_id *treeish_name,
|
||||
const struct submodule *submodule_from_name(struct repository *r,
|
||||
const struct object_id *treeish_name,
|
||||
const char *name)
|
||||
{
|
||||
gitmodules_read_check(the_repository);
|
||||
return config_from(the_repository->submodule_cache, treeish_name, name, lookup_name);
|
||||
gitmodules_read_check(r);
|
||||
return config_from(r->submodule_cache, treeish_name, name, lookup_name);
|
||||
}
|
||||
|
||||
const struct submodule *submodule_from_path(const struct object_id *treeish_name,
|
||||
const struct submodule *submodule_from_path(struct repository *r,
|
||||
const struct object_id *treeish_name,
|
||||
const char *path)
|
||||
{
|
||||
gitmodules_read_check(the_repository);
|
||||
return config_from(the_repository->submodule_cache, treeish_name, path, lookup_path);
|
||||
gitmodules_read_check(r);
|
||||
return config_from(r->submodule_cache, treeish_name, path, lookup_path);
|
||||
}
|
||||
|
||||
const struct submodule *submodule_from_cache(struct repository *repo,
|
||||
|
Reference in New Issue
Block a user