diff options
author | Dmitry Ivankov <divanorama@gmail.com> | 2011-08-11 16:21:08 +0600 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-08-11 12:21:03 -0700 |
commit | 4b4963c0e1aa094900951df9e66459443111ccc9 (patch) | |
tree | ee610335e665fab5ecd99a2e7ff6723c5f48ea69 /t/t9300-fast-import.sh | |
parent | 17fb00721b854b1c469e44ad709a9cad2128f11d (diff) | |
download | git-4b4963c0e1aa094900951df9e66459443111ccc9.tar.gz |
fast-import: check committer name more strictly
The documentation declares following identity format:
(<name> SP)? LT <email> GT
where name is any string without LF and LT characters.
But fast-import just accepts any string up to first GT
instead of checking the whole format, and moreover just
writes it as is to the commit object.
git-fsck checks for [^<\n]* <[^<>\n]*> format. Note that the
space is mandatory. And the space quirk is already handled via
extending the string to the left when needed.
Modify fast-import input identity format to a slightly stricter
one - deny LF, LT and GT in both <name> and <email>. And check
for it.
This is stricter then git-fsck as fsck accepts "Name> <email>"
currently, but soon fsck check will be adjusted likewise.
Signed-off-by: Dmitry Ivankov <divanorama@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t9300-fast-import.sh')
-rwxr-xr-x | t/t9300-fast-import.sh | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh index 09ef6ba1d9..18441f8fcb 100755 --- a/t/t9300-fast-import.sh +++ b/t/t9300-fast-import.sh @@ -370,7 +370,7 @@ data <<COMMIT empty commit COMMIT INPUT_END -test_expect_failure 'B: fail on invalid committer (1)' ' +test_expect_success 'B: fail on invalid committer (1)' ' test_must_fail git fast-import <input ' git update-ref -d refs/heads/invalid-committer || true @@ -382,7 +382,7 @@ data <<COMMIT empty commit COMMIT INPUT_END -test_expect_failure 'B: fail on invalid committer (2)' ' +test_expect_success 'B: fail on invalid committer (2)' ' test_must_fail git fast-import <input ' git update-ref -d refs/heads/invalid-committer || true @@ -394,7 +394,7 @@ data <<COMMIT empty commit COMMIT INPUT_END -test_expect_failure 'B: fail on invalid committer (3)' ' +test_expect_success 'B: fail on invalid committer (3)' ' test_must_fail git fast-import <input ' git update-ref -d refs/heads/invalid-committer || true @@ -406,7 +406,7 @@ data <<COMMIT empty commit COMMIT INPUT_END -test_expect_failure 'B: fail on invalid committer (4)' ' +test_expect_success 'B: fail on invalid committer (4)' ' test_must_fail git fast-import <input ' git update-ref -d refs/heads/invalid-committer || true @@ -418,7 +418,7 @@ data <<COMMIT empty commit COMMIT INPUT_END -test_expect_failure 'B: fail on invalid committer (5)' ' +test_expect_success 'B: fail on invalid committer (5)' ' test_must_fail git fast-import <input ' git update-ref -d refs/heads/invalid-committer || true |