Skip to content

Commit

Permalink
fallback to commit.author() if commit.author_with_mailmap() fails
Browse files Browse the repository at this point in the history
  • Loading branch information
o2sh committed Jun 30, 2021
1 parent 98f5756 commit e031a88
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/onefetch/repo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,10 @@ impl<'a> Repo<'a> {
let mut total_nbr_of_commits = 0;
let mailmap = self.repo.mailmap()?;
for commit in &self.logs {
let author = commit.author_with_mailmap(&mailmap)?;
let author = match commit.author_with_mailmap(&mailmap) {
Ok(val) => val,
Err(_) => commit.author(),
};
let author_nbr_of_commits =
author_to_number_of_commits.entry(Sig::from(author)).or_insert(0);
*author_nbr_of_commits += 1;
Expand Down

0 comments on commit e031a88

Please sign in to comment.