Skip to content

Commit c10388c

Browse files
peffgitster
authored andcommitted
branch: add edit_description() helper
Rather than have a variable with a short name that is fed to git_path(), let's add a helper function that returns the full path. This avoids the dangerous git_path() function. Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent f5d284f commit c10388c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

builtin/branch.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,7 @@ static void rename_branch(const char *oldname, const char *newname, int force)
600600
strbuf_release(&newsection);
601601
}
602602

603-
static const char edit_description[] = "BRANCH_DESCRIPTION";
603+
static GIT_PATH_FUNC(edit_description, "EDIT_DESCRIPTION")
604604

605605
static int edit_branch_description(const char *branch_name)
606606
{
@@ -615,9 +615,9 @@ static int edit_branch_description(const char *branch_name)
615615
" %s\n"
616616
"Lines starting with '%c' will be stripped.\n"),
617617
branch_name, comment_line_char);
618-
write_file_buf(git_path(edit_description), buf.buf, buf.len);
618+
write_file_buf(edit_description(), buf.buf, buf.len);
619619
strbuf_reset(&buf);
620-
if (launch_editor(git_path(edit_description), &buf, NULL)) {
620+
if (launch_editor(edit_description(), &buf, NULL)) {
621621
strbuf_release(&buf);
622622
return -1;
623623
}

0 commit comments

Comments
 (0)