diff options
author | Patrick Steinhardt <ps@pks.im> | 2016-02-22 11:23:24 (GMT) |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-02-22 18:23:45 (GMT) |
commit | b81842cbbba21a400c9c7a78c5b358565936254a (patch) | |
tree | 063509f29a617d1e63263c04fa9f8b6461e1f7c2 /builtin/branch.c | |
parent | 27852b2c5347ecd815301e668e7415509f1dae07 (diff) | |
download | git-b81842cbbba21a400c9c7a78c5b358565936254a.zip git-b81842cbbba21a400c9c7a78c5b358565936254a.tar.gz git-b81842cbbba21a400c9c7a78c5b358565936254a.tar.bz2 |
branch: die on config error when unsetting upstream
When we try to unset upstream configurations we do not check
return codes for the `git_config_set` functions. As those may
indicate that we were unable to unset the respective
configuration we may exit successfully without any error message
while in fact the upstream configuration was not unset.
Fix this by dying with an error message when we cannot unset the
configuration.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/branch.c')
-rw-r--r-- | builtin/branch.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/builtin/branch.c b/builtin/branch.c index 3f6c825..0978287 100644 --- a/builtin/branch.c +++ b/builtin/branch.c @@ -791,10 +791,10 @@ int cmd_branch(int argc, const char **argv, const char *prefix) die(_("Branch '%s' has no upstream information"), branch->name); strbuf_addf(&buf, "branch.%s.remote", branch->name); - git_config_set_multivar(buf.buf, NULL, NULL, 1); + git_config_set_multivar_or_die(buf.buf, NULL, NULL, 1); strbuf_reset(&buf); strbuf_addf(&buf, "branch.%s.merge", branch->name); - git_config_set_multivar(buf.buf, NULL, NULL, 1); + git_config_set_multivar_or_die(buf.buf, NULL, NULL, 1); strbuf_release(&buf); } else if (argc > 0 && argc <= 2) { struct branch *branch = branch_get(argv[0]); |