summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/remote.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/remote.c b/src/remote.c
index db7564a59..15a00dd28 100644
--- a/src/remote.c
+++ b/src/remote.c
@@ -2228,15 +2228,21 @@ static int remove_branch_config_related_entries(
if (git_buf_printf(&buf, "branch.%.*s.merge", (int)branch_len, branch) < 0)
break;
- if ((error = git_config_delete_entry(config, git_buf_cstr(&buf))) < 0)
- break;
+ if ((error = git_config_delete_entry(config, git_buf_cstr(&buf))) < 0) {
+ if (error != GIT_ENOTFOUND)
+ break;
+ giterr_clear();
+ }
git_buf_clear(&buf);
if (git_buf_printf(&buf, "branch.%.*s.remote", (int)branch_len, branch) < 0)
break;
- if ((error = git_config_delete_entry(config, git_buf_cstr(&buf))) < 0)
- break;
+ if ((error = git_config_delete_entry(config, git_buf_cstr(&buf))) < 0) {
+ if (error != GIT_ENOTFOUND)
+ break;
+ giterr_clear();
+ }
}
if (error == GIT_ITEROVER)