mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-21 22:21:37 +00:00
Merge pull request #3862 from novalis/dturner/do-not-die-on-missing-config
remote: Handle missing config values when deleting a remote
This commit is contained in:
commit
76cfdd4612
@ -10,6 +10,9 @@ v0.24 + 1
|
|||||||
directory matching the starting directory will not prevent git from
|
directory matching the starting directory will not prevent git from
|
||||||
finding a repository in the starting directory or a parent directory.
|
finding a repository in the starting directory or a parent directory.
|
||||||
|
|
||||||
|
* Do not fail when deleting remotes in the presence of broken
|
||||||
|
global configs which contain branches.
|
||||||
|
|
||||||
### API additions
|
### API additions
|
||||||
|
|
||||||
* You can now get the user-agent used by libgit2 using the
|
* You can now get the user-agent used by libgit2 using the
|
||||||
|
14
src/remote.c
14
src/remote.c
@ -2162,15 +2162,21 @@ static int remove_branch_config_related_entries(
|
|||||||
if (git_buf_printf(&buf, "branch.%.*s.merge", (int)branch_len, branch) < 0)
|
if (git_buf_printf(&buf, "branch.%.*s.merge", (int)branch_len, branch) < 0)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if ((error = git_config_delete_entry(config, git_buf_cstr(&buf))) < 0)
|
if ((error = git_config_delete_entry(config, git_buf_cstr(&buf))) < 0) {
|
||||||
break;
|
if (error != GIT_ENOTFOUND)
|
||||||
|
break;
|
||||||
|
giterr_clear();
|
||||||
|
}
|
||||||
|
|
||||||
git_buf_clear(&buf);
|
git_buf_clear(&buf);
|
||||||
if (git_buf_printf(&buf, "branch.%.*s.remote", (int)branch_len, branch) < 0)
|
if (git_buf_printf(&buf, "branch.%.*s.remote", (int)branch_len, branch) < 0)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if ((error = git_config_delete_entry(config, git_buf_cstr(&buf))) < 0)
|
if ((error = git_config_delete_entry(config, git_buf_cstr(&buf))) < 0) {
|
||||||
break;
|
if (error != GIT_ENOTFOUND)
|
||||||
|
break;
|
||||||
|
giterr_clear();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (error == GIT_ITEROVER)
|
if (error == GIT_ITEROVER)
|
||||||
|
Loading…
Reference in New Issue
Block a user