aboutsummaryrefslogtreecommitdiffstats
path: root/builtin/submodule--helper.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2025-02-07 12:03:29 +0100
committerJunio C Hamano <gitster@pobox.com>2025-02-07 09:59:21 -0800
commitf9467895d884908d5588fc920997b2e53dfb3302 (patch)
tree2326fe2a0b5fb00b447be12c777947c6f3839988 /builtin/submodule--helper.c
parentpath: refactor `repo_worktree_path()` family of functions (diff)
downloadgit-f9467895d884908d5588fc920997b2e53dfb3302.tar.gz
git-f9467895d884908d5588fc920997b2e53dfb3302.zip
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>
Diffstat (limited to 'builtin/submodule--helper.c')
-rw-r--r--builtin/submodule--helper.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c
index f9b970f8a6..3a64f7e605 100644
--- a/builtin/submodule--helper.c
+++ b/builtin/submodule--helper.c
@@ -1301,7 +1301,7 @@ static void sync_submodule(const char *path, const char *prefix,
remote_key = xstrfmt("remote.%s.url", default_remote);
free(default_remote);
- submodule_to_gitdir(&sb, path);
+ submodule_to_gitdir(the_repository, &sb, path);
strbuf_addstr(&sb, "/config");
if (git_config_set_in_file_gently(sb.buf, remote_key, NULL, sub_origin_url))