diff options
| author | Edward Thomson <ethomson@github.com> | 2016-03-17 06:57:56 -0700 |
|---|---|---|
| committer | Edward Thomson <ethomson@github.com> | 2016-03-17 06:57:56 -0700 |
| commit | ba3493228cd16136620757b03a4df01f8caf5057 (patch) | |
| tree | 15096f389244c20a35e0c4667491ad7599729c94 /include | |
| parent | a151eb544b751ea2103b202d036df59838c93735 (diff) | |
| parent | 02d61a3b66a6e5f5bc0154d780daaf5f7b71ccd9 (diff) | |
| download | libgit2-ba3493228cd16136620757b03a4df01f8caf5057.tar.gz | |
Merge pull request #3673 from libgit2/cmn/commit-with-signature
commit: add function to attach a signature to a commit
Diffstat (limited to 'include')
| -rw-r--r-- | include/git2/commit.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/include/git2/commit.h b/include/git2/commit.h index 44ea8882b..f63a90685 100644 --- a/include/git2/commit.h +++ b/include/git2/commit.h @@ -440,6 +440,27 @@ GIT_EXTERN(int) git_commit_create_buffer( size_t parent_count, const git_commit *parents[]); +/** + * Create a commit object from the given buffer and signature + * + * Given the unsigned commit object's contents, its signature and the + * header field in which to store the signature, attach the signature + * to the commit and write it into the given repository. + * + * @param out the resulting commit id + * @param commit_content the content of the unsigned commit object + * @param signature the signature to add to the commit + * @param signature_field which header field should contain this + * signature. Leave `NULL` for the default of "gpgsig" + * @return 0 or an error code + */ +GIT_EXTERN(int) git_commit_create_with_signature( + git_oid *out, + git_repository *repo, + const char *commit_content, + const char *signature, + const char *signature_field); + /** @} */ GIT_END_DECL #endif |
