From 97645461d8bc74f95080697c1b111894698360c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn=20Nieto?= Date: Mon, 10 Feb 2014 23:50:41 +0100 Subject: commit: add a function to create a commit on top of a ref Add a way to safely create a commit which builds on top of the current commit in a given reference. --- include/git2/commit.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'include/git2') 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 -- cgit v1.2.1