diff options
| author | nulltoken <emeric.fermas@gmail.com> | 2012-10-11 14:08:32 +0200 |
|---|---|---|
| committer | nulltoken <emeric.fermas@gmail.com> | 2012-10-11 14:08:32 +0200 |
| commit | 62993b61586be9d838e52fef3b7e01ec3abd8c35 (patch) | |
| tree | 4bc170c84a2effa7e440547125627240ce4a689f /src/branch.c | |
| parent | 3548fcf5627c56cbbddaf82715e198ed8e4c7873 (diff) | |
| download | libgit2-62993b61586be9d838e52fef3b7e01ec3abd8c35.tar.gz | |
branches: propagate EEXISTS upon creation
Diffstat (limited to 'src/branch.c')
| -rw-r--r-- | src/branch.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/branch.c b/src/branch.c index 6d497b055..d0bd1c45b 100644 --- a/src/branch.c +++ b/src/branch.c @@ -77,12 +77,11 @@ int git_branch_create( if (git_buf_joinpath(&canonical_branch_name, GIT_REFS_HEADS_DIR, branch_name) < 0) goto cleanup; - if (git_reference_create_oid(&branch, repository, - git_buf_cstr(&canonical_branch_name), git_object_id(commit), force) < 0) - goto cleanup; + error = git_reference_create_oid(&branch, repository, + git_buf_cstr(&canonical_branch_name), git_object_id(commit), force); - *ref_out = branch; - error = 0; + if (!error) + *ref_out = branch; cleanup: git_object_free(commit); |
