diff options
author | Ben Straub <bs@github.com> | 2014-02-03 15:05:55 -0800 |
---|---|---|
committer | Ben Straub <bs@github.com> | 2014-02-03 15:05:55 -0800 |
commit | 586be3b889c2f8955630da14b6a703cccc340d47 (patch) | |
tree | bb72ec4b58abfe5ae4c035ab67f7f6aa17d736bd /src | |
parent | 0d847a31598a933877d94430b2fe80bade55fe1a (diff) | |
download | libgit2-586be3b889c2f8955630da14b6a703cccc340d47.tar.gz |
Add reflog parameters to git_reset
Diffstat (limited to 'src')
-rw-r--r-- | src/reset.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/reset.c b/src/reset.c index 15f7fe13a..07fd08863 100644 --- a/src/reset.c +++ b/src/reset.c @@ -94,13 +94,16 @@ cleanup: int git_reset( git_repository *repo, git_object *target, - git_reset_t reset_type) + git_reset_t reset_type, + git_signature *signature, + const char *log_message) { git_object *commit = NULL; git_index *index = NULL; git_tree *tree = NULL; int error = 0; git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT; + git_buf log_message_buf = GIT_BUF_INIT; assert(repo && target); @@ -129,9 +132,14 @@ int git_reset( goto cleanup; } + if (log_message) + git_buf_sets(&log_message_buf, log_message); + else + git_buf_sets(&log_message_buf, "reset: moving"); + /* move HEAD to the new target */ if ((error = git_reference__update_terminal(repo, GIT_HEAD_FILE, - git_object_id(commit), NULL, NULL)) < 0) + git_object_id(commit), signature, git_buf_cstr(&log_message_buf))) < 0) goto cleanup; if (reset_type == GIT_RESET_HARD) { |