libgit2

git_commit_create_with_signature

Version:

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.

Signature

int git_commit_create_with_signature(git_oid *out, git_repository *repo, const char *commit_content, const char *signature, const char *signature_field);

Parameters

In
out

the resulting commit id

const char *
In
commit_content

the content of the unsigned commit object

const char *
In
signature

the signature to add to the commit. Leave NULL to create a commit without adding a signature field.

const char *
In
signature_field

which header field should contain this signature. Leave NULL for the default of "gpgsig"

Returns

int

0 or an error code

Versions