summaryrefslogtreecommitdiff
path: root/src/git/commit.h
diff options
context:
space:
mode:
authorVicent Marti <tanoku@gmail.com>2010-09-20 01:57:53 +0300
committerVicent Marti <tanoku@gmail.com>2010-09-20 02:04:06 +0300
commit0c3596f18a6f07d8a61f8d6e2fd730a276a51599 (patch)
tree02add71c1efc95d8c9eead36edca9b2996f5d602 /src/git/commit.h
parente802d8cca8b7fddb8ae157b84fb7c1e84671546d (diff)
downloadlibgit2-0c3596f18a6f07d8a61f8d6e2fd730a276a51599.tar.gz
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 <tanoku@gmail.com>
Diffstat (limited to 'src/git/commit.h')
-rw-r--r--src/git/commit.h35
1 files changed, 35 insertions, 0 deletions
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