diff options
| author | Patrick Steinhardt <ps@pks.im> | 2025-02-07 12:03:27 +0100 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-02-07 09:59:21 -0800 |
| commit | bdfc07bfdf3f4f4ef94580c0cb46eef5977bb810 (patch) | |
| tree | ec25e305b583e03f6fbacf8f5594d7188d86fdb8 /editor.c | |
| parent | 70a16ff8a162ad0b6a39d17a1699a2949e2a2674 (diff) | |
| download | git-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 'editor.c')
| -rw-r--r-- | editor.c | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -142,10 +142,8 @@ int strbuf_edit_interactively(struct repository *r, struct strbuf sb = STRBUF_INIT; int fd, res = 0; - if (!is_absolute_path(path)) { - strbuf_repo_git_path(&sb, r, "%s", path); - path = sb.buf; - } + if (!is_absolute_path(path)) + path = repo_git_path_append(r, &sb, "%s", path); fd = open(path, O_WRONLY | O_CREAT | O_TRUNC, 0666); if (fd < 0) |
