summaryrefslogtreecommitdiff
path: root/builtin/branch.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-07-19 13:22:23 -0700
committerJunio C Hamano <gitster@pobox.com>2016-07-19 13:22:23 -0700
commit2b6456b8089e42232d80672525edbe411ba41549 (patch)
treeb80371caee35146d5cab5c415aac68bfafb1e014 /builtin/branch.c
parent96e08010ee5b9d1dbfbcc8561fa69f972a415a38 (diff)
parent7eb6e10c9d7f43913615667740d1b22055cfba1f (diff)
downloadgit-2b6456b8089e42232d80672525edbe411ba41549.tar.gz
Merge branch 'jk/write-file'
General code clean-up around a helper function to write a single-liner to a file. * jk/write-file: branch: use write_file_buf instead of write_file use write_file_buf where applicable write_file: add format attribute write_file: add pointer+len variant write_file: use xopen write_file: drop "gently" form branch: use non-gentle write_file for branch description am: ignore return value of write_file() config: fix bogus fd check when setting up default config
Diffstat (limited to 'builtin/branch.c')
-rw-r--r--builtin/branch.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/builtin/branch.c b/builtin/branch.c
index 12203fdcc8..bf0672578f 100644
--- a/builtin/branch.c
+++ b/builtin/branch.c
@@ -618,10 +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);
- if (write_file_gently(git_path(edit_description), "%s", buf.buf)) {
- strbuf_release(&buf);
- return error_errno(_("could not write branch description template"));
- }
+ 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);