Skip to content

Commit

Permalink
Correct mailmapping of empty email addresses
Browse files Browse the repository at this point in the history
`not old_email` doesn't distinguish between `None` and an empty string,
causing old emails specified as `<>` to apply to every single commit.

Signed-off-by: Riley Iverson <[email protected]>
  • Loading branch information
Riley Iverson committed Oct 3, 2022
1 parent fff5f43 commit 91f16fd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions git-filter-repo
Original file line number Diff line number Diff line change
Expand Up @@ -320,8 +320,8 @@ class MailmapInfo(object):
for old, new in self.changes.items():
old_name, old_email = old
new_name, new_email = new
if (not old_email or email.lower() == old_email.lower()) and (
name == old_name or not old_name):
if (old_email is None or email.lower() == old_email.lower()) and (
name == old_name or not old_name):
return (new_name or name, new_email or email)
return (name, email)

Expand Down

0 comments on commit 91f16fd

Please sign in to comment.