summaryrefslogtreecommitdiff
path: root/submodule-config.c
diff options
context:
space:
mode:
authorStefan Beller <sbeller@google.com>2018-03-28 22:35:29 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-03-29 16:44:50 (GMT)
commit3b8fb393bc32f8d96c2eb4c89349c864e5c56039 (patch)
tree98f5dff330383e8f12503faf6e0739c251050b25 /submodule-config.c
parentf793b895fd752e37301702eaff948a40e7c0a4b8 (diff)
downloadgit-3b8fb393bc32f8d96c2eb4c89349c864e5c56039.zip
git-3b8fb393bc32f8d96c2eb4c89349c864e5c56039.tar.gz
git-3b8fb393bc32f8d96c2eb4c89349c864e5c56039.tar.bz2
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>
Diffstat (limited to 'submodule-config.c')
-rw-r--r--submodule-config.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/submodule-config.c b/submodule-config.c
index 5b4f0ba..0ea1e92 100644
--- a/submodule-config.c
+++ b/submodule-config.c
@@ -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,