pub struct Commit {
pub tree: ObjectId,
pub parents: SmallVec<[ObjectId; 1]>,
pub author: Signature,
pub committer: Signature,
pub encoding: Option<BString>,
pub message: BString,
pub extra_headers: Vec<(BString, BString)>,
}Expand description
A mutable git commit, representing an annotated state of a working tree along with a reference to its historical commits.
Fields§
§tree: ObjectIdThe hash of recorded working tree state.
parents: SmallVec<[ObjectId; 1]>Hash of each parent commit. Empty for the first commit in repository.
Who wrote this commit.
committer: SignatureWho committed this commit.
This may be different from the author in case the author couldn’t write to the repository themselves and
is commonly encountered with contributed commits.
encoding: Option<BString>The name of the message encoding, otherwise UTF-8 should be assumed.
message: BStringThe commit message documenting the change.
extra_headers: Vec<(BString, BString)>Extra header fields, in order of them being encountered, made accessible with the iterator returned
by extra_headers().
Implementations§
Source§impl Commit
impl Commit
Sourcepub fn extra_headers(
&self,
) -> ExtraHeaders<impl Iterator<Item = (&BStr, &BStr)>>
pub fn extra_headers( &self, ) -> ExtraHeaders<impl Iterator<Item = (&BStr, &BStr)>>
Returns a convenient iterator over all extra headers.
Source§impl Commit
impl Commit
Sourcepub fn sign(self, options: Options) -> Result<Commit>
Available on crate feature signature only.
pub fn sign(self, options: Options) -> Result<Commit>
signature only.Return this commit with its active signature replaced by a newly created one according to options.
Unsuccessful signer exits provide program, exit_status, stdout, stderr, and, when available, exit_code
according to the external program runtime failure schema.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Commit
Available on crate feature serde only.
impl<'de> Deserialize<'de> for Commit
serde only.