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 | |
parent | 67c4716f74f322b79a3e4355c273bc423eb58ec6 (diff) | |
download | libgit2-b31ebfbc666202fb576f7eb406d7a699134da09d.tar.gz |
Add reflog params to git_branch_create
Diffstat (limited to 'src')
-rw-r--r-- | src/branch.c | 16 | ||||
-rw-r--r-- | src/clone.c | 2 |
2 files changed, 10 insertions, 8 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; } diff --git a/src/clone.c b/src/clone.c index 2bf2fc509..288e9d2c8 100644 --- a/src/clone.c +++ b/src/clone.c @@ -38,7 +38,7 @@ static int create_branch( return error; /* Create the new branch */ - error = git_branch_create(&branch_ref, repo, name, head_obj, 0); + error = git_branch_create(&branch_ref, repo, name, head_obj, 0, NULL, NULL); git_commit_free(head_obj); |