mirror of
https://github.com/newren/git-filter-repo.git
synced 2024-07-03 17:05:39 +02:00
Merge branch 'mw/empty-author-name' into main
Signed-off-by: Elijah Newren <newren@gmail.com>
This commit is contained in:
commit
93ee4ae907
|
@ -1189,13 +1189,14 @@ class FastExportParser(object):
|
||||||
original_id = self._parse_original_id();
|
original_id = self._parse_original_id();
|
||||||
|
|
||||||
author_name = None
|
author_name = None
|
||||||
|
author_email = None
|
||||||
if self._currentline.startswith(b'author'):
|
if self._currentline.startswith(b'author'):
|
||||||
(author_name, author_email, author_date) = self._parse_user(b'author')
|
(author_name, author_email, author_date) = self._parse_user(b'author')
|
||||||
|
|
||||||
(committer_name, committer_email, committer_date) = \
|
(committer_name, committer_email, committer_date) = \
|
||||||
self._parse_user(b'committer')
|
self._parse_user(b'committer')
|
||||||
|
|
||||||
if not author_name:
|
if not author_name and not author_email:
|
||||||
(author_name, author_email, author_date) = \
|
(author_name, author_email, author_date) = \
|
||||||
(committer_name, committer_email, committer_date)
|
(committer_name, committer_email, committer_date)
|
||||||
|
|
||||||
|
|
|
@ -1674,4 +1674,37 @@ test_expect_success '--version' '
|
||||||
test_cmp expect actual
|
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 <empty@ident.ity> 1535228562 -0700
|
||||||
|
committer Full Name <email@add.ress> 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
|
test_done
|
||||||
|
|
Loading…
Reference in New Issue
Block a user