summaryrefslogtreecommitdiff
path: root/include/git2/commit.h
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2016-02-08 18:51:13 +0100
committerCarlos Martín Nieto <cmn@dwim.me>2016-02-09 15:58:16 +0100
commita65afb757e2675eb8889a9ce1f8809434cdb3af7 (patch)
tree560d6cf3ffb0eec439ad03afab83e6575e2e9326 /include/git2/commit.h
parent0f9d15493d5d8ad4353dd7beed52c9567334f6e5 (diff)
downloadlibgit2-a65afb757e2675eb8889a9ce1f8809434cdb3af7.tar.gz
Introduce git_commit_extract_signaturegpgsign
This returns the GPG signature for a commit and its contents without the signature block, allowing for the verification of the commit's signature.
Diffstat (limited to 'include/git2/commit.h')
-rw-r--r--include/git2/commit.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/git2/commit.h b/include/git2/commit.h
index 34d29ed81..a92277417 100644
--- a/include/git2/commit.h
+++ b/include/git2/commit.h
@@ -264,6 +264,18 @@ GIT_EXTERN(int) git_commit_nth_gen_ancestor(
GIT_EXTERN(int) git_commit_header_field(git_buf *out, const git_commit *commit, const char *field);
/**
+ * Extract the signature from a commit
+ *
+ * @param signature the signature block
+ * @param signed_data signed data; this is the commit contents minus the signature block
+ * @param repo the repository in which the commit exists
+ * @param commit_id the commit from which to extract the data
+ * @param field the name of the header field containing the signature
+ * block; pass `NULL` to extract the default 'gpgsig'
+ */
+GIT_EXTERN(int) git_commit_extract_signature(git_buf *signature, git_buf *signed_data, git_repository *repo, git_oid *commit_id, 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