From 0c3596f18a6f07d8a61f8d6e2fd730a276a51599 Mon Sep 17 00:00:00 2001 From: Vicent Marti Date: Mon, 20 Sep 2010 01:57:53 +0300 Subject: Add setter methods & write support for git_commit All the required git_commit_set_XXX methods have been implemented; all the attributes of a commit object can now be modified in-memory. The new method git_object_write() automatically writes back the in-memory changes of any object to the repository. So far it only supports git_commit objects. Signed-off-by: Vicent Marti --- src/git/commit.h | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'src/git/commit.h') diff --git a/src/git/commit.h b/src/git/commit.h index 56243c5be..4387925da 100644 --- a/src/git/commit.h +++ b/src/git/commit.h @@ -79,6 +79,41 @@ GIT_EXTERN(const git_person *) git_commit_author(git_commit *commit); */ GIT_EXTERN(const git_tree *) git_commit_tree(git_commit *commit); +/* + * Add a new parent commit to an existing commit + * @param commit the commit object + * @param new_parent the new commit which will be a parent + */ +GIT_EXTERN(void) git_commit_add_parent(git_commit *commit, git_commit *new_parent); + +/* + * Set the message of a commit + * @param commit the commit object + * @param message the new message + */ +GIT_EXTERN(void) git_commit_set_message(git_commit *commit, const char *message); + +/* + * Set the committer of a commit + * @param commit the commit object + * @param committer the new committer + */ +GIT_EXTERN(void) git_commit_set_committer(git_commit *commit, const git_person *committer); + +/* + * Set the author of a commit + * @param commit the commit object + * @param author the new author + */ +GIT_EXTERN(void) git_commit_set_author(git_commit *commit, const git_person *author); + +/* + * Set the tree which is pointed to by a commit + * @param commit the commit object + * @param tree the new tree + */ +GIT_EXTERN(void) git_commit_set_tree(git_commit *commit, git_tree *tree); + /** @} */ GIT_END_DECL #endif -- cgit v1.2.1