summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2015-03-03 13:03:54 +0100
committerCarlos Martín Nieto <cmn@dwim.me>2015-03-03 13:03:54 +0100
commit5ac2b7cb2ae67aa7a8a7b4d171c54ea69140516a (patch)
treea2231801d9dcd35eb474c228c0dd4e0c8021af0d /src
parentbf410446ddd651ba15f10730844b19b53a579763 (diff)
parent79863917191aaf513fe93029749f655de361eb43 (diff)
downloadlibgit2-5ac2b7cb2ae67aa7a8a7b4d171c54ea69140516a.tar.gz
Merge pull request #2937 from git-up/branch_delete_reflog
git_branch_delete() should ignore errors from non-existing reflogs
Diffstat (limited to 'src')
-rw-r--r--src/branch.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/branch.c b/src/branch.c
index b4e4b0564..06b93ddca 100644
--- a/src/branch.c
+++ b/src/branch.c
@@ -138,8 +138,13 @@ int git_branch_delete(git_reference *branch)
if (git_reference_delete(branch) < 0)
goto on_error;
- if (git_reflog_delete(git_reference_owner(branch), git_reference_name(branch)) < 0)
+ if (git_reflog_delete(git_reference_owner(branch), git_reference_name(branch)) < 0) {
+ if (error == GIT_ENOTFOUND) {
+ giterr_clear();
+ error = 0;
+ }
goto on_error;
+ }
error = 0;