From a3f42fe8e4cdae8c85ba5d7d7b4c9fd1247d5227 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn=20Nieto?= Date: Mon, 22 Jun 2015 15:32:29 +0200 Subject: 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. --- include/git2/commit.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'include/git2') diff --git a/include/git2/commit.h b/include/git2/commit.h index fb53a701b..04711c1fa 100644 --- a/include/git2/commit.h +++ b/include/git2/commit.h @@ -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 * -- cgit v1.2.1