diff options
author | Ben Straub <bs@github.com> | 2014-01-27 14:12:29 -0800 |
---|---|---|
committer | Ben Straub <bs@github.com> | 2014-01-30 15:52:13 -0800 |
commit | b31ebfbc666202fb576f7eb406d7a699134da09d (patch) | |
tree | 0abe6c1811c595e41cb18c5adbd0e40756737148 /src/branch.c | |
parent | 67c4716f74f322b79a3e4355c273bc423eb58ec6 (diff) | |
download | libgit2-b31ebfbc666202fb576f7eb406d7a699134da09d.tar.gz |
Add reflog params to git_branch_create
Diffstat (limited to 'src/branch.c')
-rw-r--r-- | src/branch.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/branch.c b/src/branch.c index d0dc21b85..a989cb61d 100644 --- a/src/branch.c +++ b/src/branch.c @@ -54,7 +54,9 @@ int git_branch_create( git_repository *repository, const char *branch_name, const git_commit *commit, - int force) + int force, + const git_signature *signature, + const char *log_message) { git_reference *branch = NULL; git_buf canonical_branch_name = GIT_BUF_INIT; @@ -63,14 +65,14 @@ int git_branch_create( assert(branch_name && commit && ref_out); assert(git_object_owner((const git_object *)commit) == repository); - if (!(error = git_buf_joinpath( - &canonical_branch_name, GIT_REFS_HEADS_DIR, branch_name))) - error = git_reference_create( - &branch, repository, git_buf_cstr(&canonical_branch_name), - git_commit_id(commit), force, NULL, NULL); + if (git_buf_joinpath(&canonical_branch_name, GIT_REFS_HEADS_DIR, branch_name) < 0) + goto cleanup; - *ref_out = branch; + if (!(error = git_reference_create(&branch, repository, + git_buf_cstr(&canonical_branch_name), git_commit_id(commit), force, signature, log_message))) + *ref_out = branch; +cleanup: git_buf_free(&canonical_branch_name); return error; } |