Skip to content

Commit 8f1b42b

Browse files
committed
feat: CommitRef::time() (#364)
A shortcut to allow for fluid retrival of the `committer.time`.
1 parent 0057804 commit 8f1b42b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

git-object/src/commit/mod.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@ impl<'a> CommitRef<'a> {
5252
pub fn message(&self) -> MessageRef<'a> {
5353
MessageRef::from_bytes(self.message)
5454
}
55+
56+
/// Returns the time at which this commit was created.
57+
pub fn time(&self) -> git_actor::Time {
58+
self.committer.time
59+
}
5560
}
5661

5762
impl Commit {

0 commit comments

Comments
 (0)