mirror of
https://github.com/git/git.git
synced 2025-12-12 20:36:24 +01:00
submodule: refactor submodule_to_gitdir() to accept a repo
The `submodule_to_gitdir()` function implicitly uses `the_repository` to resolve submodule paths. Refactor the function to instead accept a repo as parameter to remove the dependency on global state. 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
93a8cfaf3c
commit
f9467895d8
2
path.c
2
path.c
@@ -567,7 +567,7 @@ static int do_submodule_path(struct strbuf *buf, const char *path,
|
||||
struct strbuf git_submodule_dir = STRBUF_INIT;
|
||||
int ret;
|
||||
|
||||
ret = submodule_to_gitdir(&git_submodule_dir, path);
|
||||
ret = submodule_to_gitdir(the_repository, &git_submodule_dir, path);
|
||||
if (ret)
|
||||
goto cleanup;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user