summaryrefslogtreecommitdiff
path: root/src/branch.c
diff options
context:
space:
mode:
authornulltoken <emeric.fermas@gmail.com>2012-05-13 10:17:52 +0200
committernulltoken <emeric.fermas@gmail.com>2012-05-13 10:30:13 +0200
commit341a7136f6c38da008544137d2dcc39cfc846279 (patch)
tree3e60010fec3abcc87587b5695dea53d876bd4d83 /src/branch.c
parentb72969e0643cb561b42aceec4d1a18ce9c782c09 (diff)
downloadlibgit2-341a7136f6c38da008544137d2dcc39cfc846279.tar.gz
branch: make git_branch_delete() return GIT_ENOTFOUND when the branch doesn't exist
Diffstat (limited to 'src/branch.c')
-rw-r--r--src/branch.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/branch.c b/src/branch.c
index c980cf08c..6d5880cb2 100644
--- a/src/branch.c
+++ b/src/branch.c
@@ -114,7 +114,7 @@ int git_branch_delete(git_repository *repo, const char *branch_name, git_branch_
assert((branch_type == GIT_BRANCH_LOCAL) || (branch_type == GIT_BRANCH_REMOTE));
if ((error = retrieve_branch_reference(&branch, repo, branch_name, branch_type == GIT_BRANCH_REMOTE)) < 0)
- goto on_error;
+ return error;
if (git_reference_lookup(&head, repo, GIT_HEAD_FILE) < 0) {
giterr_set(GITERR_REFERENCE, "Cannot locate HEAD.");