pub trait Sign {
// Required method
fn sign(&self, commit: &[u8]) -> Result<(String, Option<String>), SignError>;
}
Expand description
Sign commit data using various methods
Required Methods§
Sourcefn sign(&self, commit: &[u8]) -> Result<(String, Option<String>), SignError>
fn sign(&self, commit: &[u8]) -> Result<(String, Option<String>), SignError>
Sign commit with the respective implementation.
Retrieve an implementation using
SignBuilder::from_gitconfig
.
The commit
buffer can be created using the following steps:
- create a buffer using
git2::Repository::commit_create_buffer
The function returns a tuple of signature
and
signature_field
. These values can then be passed into
git2::Repository::commit_signed
. Finally, the repository
head needs to be advanced to the resulting commit ID
using git2::Reference::set_target
.