Trait Sign

Source
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§

Source

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:

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.

Implementors§