diff options
| author | Carlos Martín Nieto <carlos@cmartin.tk> | 2012-08-01 17:49:19 +0200 |
|---|---|---|
| committer | Carlos Martín Nieto <carlos@cmartin.tk> | 2012-08-01 18:39:20 +0200 |
| commit | 074841ec6ae2cc70391544ea76082bc4e2c4a1bf (patch) | |
| tree | a0c9b36cc08aff7074b2b2884304ba7bda4609fe /include/git2/repository.h | |
| parent | 2340b18102eedc73cbbfeca43f0b22e5d4119c38 (diff) | |
| download | libgit2-074841ec6ae2cc70391544ea76082bc4e2c4a1bf.tar.gz | |
repository: add a getter and remove function for git's prepared message
The 'git revert/cherry-pick/merge -n' commands leave .git/MERGE_MSG
behind so that git-commit can find it. As we don't yet support these
operations, users who are shelling out to let git perform these
operations haven't had a convenient way to get this message.
These functions allow the user to retrieve the message and remove it
when she's created the commit.
Diffstat (limited to 'include/git2/repository.h')
| -rw-r--r-- | include/git2/repository.h | 22 |
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 |
