From 30598ad06f2adfef1f74d6348677358865cbf373 Mon Sep 17 00:00:00 2001 From: Patrick Steinhardt Date: Mon, 22 Feb 2016 12:23:35 +0100 Subject: config: rename git_config_set to git_config_set_gently The desired default behavior for `git_config_set` is to die whenever an error occurs. Dying is the default for a lot of internal functions when failures occur and is in this case the right thing to do for most callers as otherwise we might run into inconsistent repositories without noticing. As some code may rely on the actual return values for `git_config_set` we still require the ability to invoke these functions without aborting. Rename the existing `git_config_set` functions to `git_config_set_gently` to keep them available for those callers. Signed-off-by: Patrick Steinhardt Signed-off-by: Junio C Hamano --- branch.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'branch.c') diff --git a/branch.c b/branch.c index 713ceda36a..c50ea42172 100644 --- a/branch.c +++ b/branch.c @@ -70,18 +70,18 @@ int install_branch_config(int flag, const char *local, const char *origin, const } strbuf_addf(&key, "branch.%s.remote", local); - if (git_config_set(key.buf, origin ? origin : ".") < 0) + if (git_config_set_gently(key.buf, origin ? origin : ".") < 0) goto out_err; strbuf_reset(&key); strbuf_addf(&key, "branch.%s.merge", local); - if (git_config_set(key.buf, remote) < 0) + if (git_config_set_gently(key.buf, remote) < 0) goto out_err; if (rebasing) { strbuf_reset(&key); strbuf_addf(&key, "branch.%s.rebase", local); - if (git_config_set(key.buf, "true") < 0) + if (git_config_set_gently(key.buf, "true") < 0) goto out_err; } strbuf_release(&key); -- cgit 1.2.3-korg