Skip to content

Commit 93ee4ae

Browse files
committed
Merge branch 'mw/empty-author-name' into main
Signed-off-by: Elijah Newren <[email protected]>
2 parents 7eaaf19 + 282f8dd commit 93ee4ae

File tree

2 files changed

+35
-1
lines changed

2 files changed

+35
-1
lines changed

git-filter-repo

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1189,13 +1189,14 @@ class FastExportParser(object):
11891189
original_id = self._parse_original_id();
11901190

11911191
author_name = None
1192+
author_email = None
11921193
if self._currentline.startswith(b'author'):
11931194
(author_name, author_email, author_date) = self._parse_user(b'author')
11941195

11951196
(committer_name, committer_email, committer_date) = \
11961197
self._parse_user(b'committer')
11971198

1198-
if not author_name:
1199+
if not author_name and not author_email:
11991200
(author_name, author_email, author_date) = \
12001201
(committer_name, committer_email, committer_date)
12011202

t/t9390-filter-repo.sh

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1674,4 +1674,37 @@ test_expect_success '--version' '
16741674
test_cmp expect actual
16751675
'
16761676

1677+
test_expect_success 'empty author ident' '
1678+
test_create_repo empty_author_ident &&
1679+
(
1680+
cd empty_author_ident &&
1681+
1682+
git init &&
1683+
cat <<-EOF | git fast-import --quiet &&
1684+
feature done
1685+
blob
1686+
mark :1
1687+
data 8
1688+
initial
1689+
1690+
reset refs/heads/develop
1691+
commit refs/heads/develop
1692+
mark :2
1693+
author <[email protected]> 1535228562 -0700
1694+
committer Full Name <[email protected]> 1535228562 -0700
1695+
data 8
1696+
Initial
1697+
M 100644 :1 filename
1698+
1699+
done
1700+
EOF
1701+
1702+
git filter-repo --force --path-rename filename:stuff &&
1703+
1704+
git log --format=%an develop >actual &&
1705+
echo >expect &&
1706+
test_cmp expect actual
1707+
)
1708+
'
1709+
16771710
test_done

0 commit comments

Comments
 (0)