History

Merge branch 'oknozor-feat/traversal-sort-by-committer-date'

Sebastian Thiel committed 4 years ago

Commit 6add3772 parents fda2a8d 5cf93234 files · +269 −85Browse files

Showing the changes to git-object/src/commit (1 of 4 files). Show all

Unified · Split

git-object/src/commit/ref_iter.rs+9−0
@@ -65,6 +65,15 @@ impl<'a> CommitRefIter<'a> { · 64 unmodified lines
6565 _ => None,
6666 })
6767 }
68+
69+ /// Returns the committer signature if there is no decoding error.
70+ /// Errors are coerced into options, hiding whether there was an error or not. The caller knows if there was an error or not.
71+ pub fn committer(&mut self) -> Option<git_actor::SignatureRef<'_>> {
72+ self.find_map(|t| match t {
73+ Ok(Token::Committer { signature }) => Some(signature),
74+ _ => None,
75+ })
76+ }
6877 }
6978
7079 impl<'a> CommitRefIter<'a> {