Skip to content

Commit

Permalink
branch: die on config error when editing branch description
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Patrick Steinhardt authored and Junio C Hamano committed Feb 22, 2016
1 parent b81842c commit bd25f89
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions builtin/branch.c
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,6 @@ static const char edit_description[] = "BRANCH_DESCRIPTION";

static int edit_branch_description(const char *branch_name)
{
int status;
struct strbuf buf = STRBUF_INIT;
struct strbuf name = STRBUF_INIT;

Expand All @@ -595,11 +594,11 @@ static int edit_branch_description(const char *branch_name)
strbuf_stripspace(&buf, 1);

strbuf_addf(&name, "branch.%s.description", branch_name);
status = git_config_set(name.buf, buf.len ? buf.buf : NULL);
git_config_set_or_die(name.buf, buf.len ? buf.buf : NULL);
strbuf_release(&name);
strbuf_release(&buf);

return status;
return 0;
}

int cmd_branch(int argc, const char **argv, const char *prefix)
Expand Down

0 comments on commit bd25f89

Please sign in to comment.