commit: introduce git_commit_body

It is already possible to get a commit's summary with the
`git_commit_summary` function. It is not possible to get the
remaining part of the commit message, that is the commit
message's body.

Fix this by introducing a new function `git_commit_body`.
This commit is contained in:
Patrick Steinhardt
2015-12-01 10:03:56 +01:00
parent 337b2b08f4
commit 7f8fe1d45e
4 changed files with 81 additions and 0 deletions

View File

@@ -127,6 +127,19 @@ GIT_EXTERN(const char *) git_commit_message_raw(const git_commit *commit);
*/
GIT_EXTERN(const char *) git_commit_summary(git_commit *commit);
/**
* Get the long "body" of the git commit message.
*
* The returned message is the body of the commit, comprising
* everything but the first paragraph of the message. Leading and
* trailing whitespaces are trimmed.
*
* @param commit a previously loaded commit.
* @return the body of a commit or NULL when no the message only
* consists of a summary
*/
GIT_EXTERN(const char *) git_commit_body(git_commit *commit);
/**
* Get the commit time (i.e. committer time) of a commit.
*