aboutsummaryrefslogtreecommitdiffstats
path: root/submodule.h
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 /submodule.h
parent93a8cfaf3c24f8c1f999b2ca5532ff8f46e0808d (diff)
downloadgit-f9467895d884908d5588fc920997b2e53dfb3302.tar.gz
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 'submodule.h')
-rw-r--r--submodule.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/submodule.h b/submodule.h
index 4deb1b5f84..db980c1d08 100644
--- a/submodule.h
+++ b/submodule.h
@@ -136,7 +136,8 @@ int push_unpushed_submodules(struct repository *r,
* path of that submodule in 'buf'. Return -1 on error or when the
* submodule is not initialized.
*/
-int submodule_to_gitdir(struct strbuf *buf, const char *submodule);
+int submodule_to_gitdir(struct repository *repo,
+ struct strbuf *buf, const char *submodule);
/*
* Given a submodule name, create a path to where the submodule's gitdir lives