diff options
author | Carlos Martín Nieto <cmn@dwim.me> | 2014-02-10 23:50:41 +0100 |
---|---|---|
committer | Carlos Martín Nieto <cmn@dwim.me> | 2014-02-10 23:50:41 +0100 |
commit | 97645461d8bc74f95080697c1b111894698360c8 (patch) | |
tree | 19f8ae3f922c593336e96740436d5416630b62f1 /include/git2/commit.h | |
parent | b362fbf363f1793fe9b190f57ecb04afd26b09ce (diff) | |
download | libgit2-cmn/safe-commit.tar.gz |
commit: add a function to create a commit on top of a refcmn/safe-commit
Add a way to safely create a commit which builds on top of the current
commit in a given reference.
Diffstat (limited to 'include/git2/commit.h')
-rw-r--r-- | include/git2/commit.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/include/git2/commit.h b/include/git2/commit.h index 834330b5d..78deb6de0 100644 --- a/include/git2/commit.h +++ b/include/git2/commit.h @@ -351,6 +351,25 @@ GIT_EXTERN(int) git_commit_amend( const char *message, const git_tree *tree); +/** + * Create a commit on top of the tip of a given branch + * + * All parameters have the same meaning as in `git_commit_create()` + * with the exception that `update_ref` is required and the new + * commit's single parent will be the value of that ref at the time of + * reading. + */ +int git_commit_append( + git_oid *id, + git_repository *repo, + const char *update_ref, + const git_signature *author, + const git_signature *committer, + const char *message_encoding, + const char *message, + const git_tree *tree); + + /** @} */ GIT_END_DECL #endif |