pub struct CommitRef<'a> {
pub tree: ObjectId,
pub parents: Vec<ObjectId>,
pub author: &'a [u8],
pub committer: &'a [u8],
pub encoding: Option<&'a [u8]>,
pub message: &'a [u8],
}Expand description
A borrowed parse-view of a raw commit object.
The identity, encoding, and message slices point into the original commit
body. Object ids are parsed into fixed-size values while preserving the same
validation behavior as Commit::parse. Like Commit, this is a parsed
canonical view of known fields rather than a byte-lossless view of every raw
header.
Fields§
§tree: ObjectId§parents: Vec<ObjectId>§committer: &'a [u8]§encoding: Option<&'a [u8]>§message: &'a [u8]Implementations§
Source§impl<'a> CommitRef<'a>
impl<'a> CommitRef<'a>
pub fn parse(format: ObjectFormat, bytes: &'a [u8]) -> Result<Self>
pub fn to_owned(&self) -> Commit
Parse the raw author line into a typed
Signature parse-view, or None if the stored bytes are not a
well-formed git identity.
This is a read-only lens: it does not touch the raw author bytes, which
remain the source of truth for Commit::write. The returned signature
re-serializes byte-identically to author (see
Signature::to_ident_bytes).
Sourcepub fn committer_signature(&self) -> Option<Signature>
pub fn committer_signature(&self) -> Option<Signature>
Parse the raw committer line into a typed
Signature parse-view, or None if the stored bytes are not a
well-formed git identity. Read-only over the raw bytes, exactly like
Commit::author_signature.