summaryrefslogtreecommitdiff
path: root/include/git2/commit.h
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2015-06-22 15:32:29 +0200
committerCarlos Martín Nieto <cmn@dwim.me>2015-06-22 15:56:31 +0200
commita3f42fe8e4cdae8c85ba5d7d7b4c9fd1247d5227 (patch)
tree123f33cbc69abe842fe66f1d1eea448a9127575d /include/git2/commit.h
parente96a97f18e8f961c434e4fa4fc2c7d950480b9e9 (diff)
downloadlibgit2-cmn/commit-header-field.tar.gz
commit: allow retrieving an arbitrary header fieldcmn/commit-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.
Diffstat (limited to 'include/git2/commit.h')
-rw-r--r--include/git2/commit.h11
1 files changed, 11 insertions, 0 deletions
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
@@ -240,6 +240,17 @@ GIT_EXTERN(int) git_commit_nth_gen_ancestor(
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
*
* The message will **not** be cleaned up automatically. You can do that