diff options
author | Jeff King <peff@peff.net> | 2016-07-07 16:31:58 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-07-07 14:23:06 -0700 |
commit | 9453f9524774174b77bd5fc92c87b365198fc339 (patch) | |
tree | c978b5caa8822f3498819931728ba9cb9daef329 /builtin/branch.c | |
parent | 05219a1276341e72d8082d76b7f5ed394b7437a4 (diff) | |
download | git-jk/no-write-file-gently.tar.gz |
write_file(): drop "gently" formjk/no-write-file-gently
We have two forms of write_file(): one that dies, and one
that returns an error. However, the latter has only a single
caller, which immediately dies anyway (after producing a
message that is not really any more informative than
write_file's generic die(), and arguably worse because it
does not give the actual filename).
Let's convert that site to use the non-gentle form. At that
point the gentle form has no callers, and we can simplify
the implementation of write_file.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/branch.c')
-rw-r--r-- | builtin/branch.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/builtin/branch.c b/builtin/branch.c index 2ecde53bf8..15232c4a42 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(git_path(edit_description), "%s", buf.buf); strbuf_reset(&buf); if (launch_editor(git_path(edit_description), &buf, NULL)) { strbuf_release(&buf); |