diff --git a/git-filter-repo b/git-filter-repo index 3c7fd0c..10401e4 100755 --- a/git-filter-repo +++ b/git-filter-repo @@ -1189,13 +1189,14 @@ class FastExportParser(object): original_id = self._parse_original_id(); author_name = None + author_email = None if self._currentline.startswith(b'author'): (author_name, author_email, author_date) = self._parse_user(b'author') (committer_name, committer_email, committer_date) = \ self._parse_user(b'committer') - if not author_name: + if not author_name and not author_email: (author_name, author_email, author_date) = \ (committer_name, committer_email, committer_date) diff --git a/t/t9390-filter-repo.sh b/t/t9390-filter-repo.sh index d2186b0..8ab4749 100755 --- a/t/t9390-filter-repo.sh +++ b/t/t9390-filter-repo.sh @@ -1674,4 +1674,37 @@ test_expect_success '--version' ' test_cmp expect actual ' +test_expect_success 'empty author ident' ' + test_create_repo empty_author_ident && + ( + cd empty_author_ident && + + git init && + cat <<-EOF | git fast-import --quiet && + feature done + blob + mark :1 + data 8 + initial + + reset refs/heads/develop + commit refs/heads/develop + mark :2 + author 1535228562 -0700 + committer Full Name 1535228562 -0700 + data 8 + Initial + M 100644 :1 filename + + done + EOF + + git filter-repo --force --path-rename filename:stuff && + + git log --format=%an develop >actual && + echo >expect && + test_cmp expect actual + ) +' + test_done