pub struct Commit<'a> { /* private fields */ }Expand description
A commit as stored in a File.
Implementations§
Source§impl<'a> Commit<'a>
impl<'a> Commit<'a>
Sourcepub fn committer_timestamp(&self) -> u64
pub fn committer_timestamp(&self) -> u64
Returns the committer timestamp of this commit.
The value is the number of seconds since 1970-01-01 00:00:00 UTC.
Sourcepub fn generation(&self) -> u32
pub fn generation(&self) -> u32
Returns the generation number of this commit.
Commits without parents have generation number 1. Commits with parents have a generation number that is the max of their parents’ generation numbers + 1.
Sourcepub fn corrected_commit_date(&self) -> Result<Option<u64>>
pub fn corrected_commit_date(&self) -> Result<Option<u64>>
Return the corrected commit date, if this file contains generation numbers version 2.
This is the maximum of one, the commit timestamp, and each parent’s corrected date plus one.
It preserves topological order even when timestamps go backwards. Check
Graph::corrected_commit_dates_available()
before comparing dates from different files in a split graph.
Malformed overflow offsets, zero dates, and dates that overflow u64 are reported as corruption.
Sourcepub fn iter_parents(self) -> Parents<'a> ⓘ
pub fn iter_parents(self) -> Parents<'a> ⓘ
Sourcepub fn position(&self) -> Position
pub fn position(&self) -> Position
Returns the position at which this commit is stored in the parent File.
Sourcepub fn root_tree_id(&self) -> &oid
pub fn root_tree_id(&self) -> &oid
Return the hash of the tree this commit points to.