History

feat(traversal): Add sorting mode to ancestor traversal #270

Paul Delafosse committed 4 years ago

Commit eb36a3d1 parent bc775344 files · +250 −80Browse 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> {