aboutsummaryrefslogtreecommitdiffstats
path: root/submodule.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2025-02-07 12:03:27 +0100
committerJunio C Hamano <gitster@pobox.com>2025-02-07 09:59:21 -0800
commitbdfc07bfdf3f4f4ef94580c0cb46eef5977bb810 (patch)
treeec25e305b583e03f6fbacf8f5594d7188d86fdb8 /submodule.c
parent70a16ff8a162ad0b6a39d17a1699a2949e2a2674 (diff)
downloadgit-bdfc07bfdf3f4f4ef94580c0cb46eef5977bb810.tar.gz
path: refactor `repo_git_path()` family of functions
As explained in an earlier commit, we're refactoring path-related functions to provide a consistent interface for computing paths into the commondir, gitdir and worktree. Refactor the "gitdir" family of functions accordingly. Note that the `repo_git_pathv()` function is converted into an internal implementation detail. It is only used to implement `the_repository` compatibility shims and will eventually be removed from the public interface. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'submodule.c')
-rw-r--r--submodule.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/submodule.c b/submodule.c
index b361076c5b..211ead54a0 100644
--- a/submodule.c
+++ b/submodule.c
@@ -1315,7 +1315,7 @@ static int repo_has_absorbed_submodules(struct repository *r)
int ret;
struct strbuf buf = STRBUF_INIT;
- strbuf_repo_git_path(&buf, r, "modules/");
+ repo_git_path_append(r, &buf, "modules/");
ret = file_exists(buf.buf) && !is_empty_dir(buf.buf);
strbuf_release(&buf);
return ret;
@@ -2629,6 +2629,6 @@ void submodule_name_to_gitdir(struct strbuf *buf, struct repository *r,
* administrators can explicitly set. Nothing has been decided,
* so for now, just append the name at the end of the path.
*/
- strbuf_repo_git_path(buf, r, "modules/");
+ repo_git_path_append(r, buf, "modules/");
strbuf_addstr(buf, submodule_name);
}