summaryrefslogtreecommitdiff
path: root/editor.c
diff options
context:
space:
mode:
Diffstat (limited to 'editor.c')
-rw-r--r--editor.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/editor.c b/editor.c
index 6b9ce81d5f..b79d97b0e7 100644
--- a/editor.c
+++ b/editor.c
@@ -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)