diff --git a/builtin/branch.c b/builtin/branch.c index 15232c4a42..1d41251a9a 100644 --- a/builtin/branch.c +++ b/builtin/branch.c @@ -618,7 +618,7 @@ static int edit_branch_description(const char *branch_name) " %s\n" "Lines starting with '%c' will be stripped.\n", branch_name, comment_line_char); - write_file(git_path(edit_description), "%s", buf.buf); + write_file_buf(git_path(edit_description), buf.buf, buf.len); strbuf_reset(&buf); if (launch_editor(git_path(edit_description), &buf, NULL)) { strbuf_release(&buf);