summaryrefslogtreecommitdiff
path: root/include/git2
diff options
context:
space:
mode:
authorVicent Martí <vicent@github.com>2012-08-01 16:21:41 -0700
committerVicent Martí <vicent@github.com>2012-08-01 16:21:41 -0700
commite5f495012d9ec04bb46fc4b47c469df232c7f245 (patch)
treeeb56f6f6b0537025b5d738cccf040ddcc33afae1 /include/git2
parentcf81ded61caa66267be5f27539decae2292ace9a (diff)
parent074841ec6ae2cc70391544ea76082bc4e2c4a1bf (diff)
downloadlibgit2-e5f495012d9ec04bb46fc4b47c469df232c7f245.tar.gz
Merge pull request #848 from carlosmn/pending-message
repository: add a getter and remove function for git's prepared message
Diffstat (limited to 'include/git2')
-rw-r--r--include/git2/repository.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/include/git2/repository.h b/include/git2/repository.h
index ef2f5413d..e727ff317 100644
--- a/include/git2/repository.h
+++ b/include/git2/repository.h
@@ -315,6 +315,28 @@ GIT_EXTERN(int) git_repository_index(git_index **out, git_repository *repo);
*/
GIT_EXTERN(void) git_repository_set_index(git_repository *repo, git_index *index);
+/**
+ * Retrive git's prepared message
+ *
+ * Operations such as git revert/cherry-pick/merge with the -n option
+ * stop just short of creating a commit with the changes and save
+ * their prepared message in .git/MERGE_MSG so the next git-commit
+ * execution can present it to the user for them to amend if they
+ * wish.
+ *
+ * Use this function to get the contents of this file. Don't forget to
+ * remove the file after you create the commit.
+ */
+GIT_EXTERN(int) git_repository_message(char *buffer, size_t len, git_repository *repo);
+
+/**
+ * Remove git's prepared message.
+ *
+ * Remove the message that `git_repository_message` retrieves.
+ */
+GIT_EXTERN(int) git_repository_message_remove(git_repository *repo);
+
+
/** @} */
GIT_END_DECL
#endif