Commit f008aeb8 by Carlos Martín Nieto

branch: do capture the error code

We want to ignore GIT_ENOTFOUND, but for that we need to capture the
error code from the reflog deletion.
parent 283f31ab
......@@ -138,7 +138,7 @@ 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 ((error = git_reflog_delete(git_reference_owner(branch), git_reference_name(branch))) < 0) {
if (error == GIT_ENOTFOUND) {
giterr_clear();
error = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment