commit: allow retrieving an arbitrary header field

This allows the user to look up fields which we don't parse in libgit2,
and allows them to access gpgsig or mergetag fields if they wish to
check the signature.
This commit is contained in:
Carlos Martín Nieto
2015-06-22 15:56:31 +02:00
parent e96a97f18e
commit a3f42fe8e4
4 changed files with 107 additions and 0 deletions
+11
View File
@@ -239,6 +239,17 @@ GIT_EXTERN(int) git_commit_nth_gen_ancestor(
const git_commit *commit,
unsigned int n);
/**
* Get an arbitrary header field
*
* @param out the buffer to fill
* @param commit the commit to look in
* @param field the header field to return
* @return 0 on succeess, GIT_ENOTFOUND if the field does not exist,
* or an error code
*/
GIT_EXTERN(int) git_commit_header_field(git_buf *out, const git_commit *commit, const char *field);
/**
* Create new commit in the repository from a list of `git_object` pointers
*