summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorĐoàn Trần Công Danh <congdanhqx@gmail.com>2020-04-20 23:54:36 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-04-22 21:01:03 (GMT)
commit391999744771002cb5feded004879f36534b9b14 (patch)
treeaa798672f7de55ac0c582d09fffcaba5ede0bec2 /t
parent2a2ff6039606b93ad08d8d377804ddcd0bc41312 (diff)
downloadgit-391999744771002cb5feded004879f36534b9b14.zip
git-391999744771002cb5feded004879f36534b9b14.tar.gz
git-391999744771002cb5feded004879f36534b9b14.tar.bz2
mailinfo: disallow NUL character in mail's header
Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t4254-am-corrupt.sh7
1 files changed, 5 insertions, 2 deletions
diff --git a/t/t4254-am-corrupt.sh b/t/t4254-am-corrupt.sh
index 1bbc37b..daf01c3 100755
--- a/t/t4254-am-corrupt.sh
+++ b/t/t4254-am-corrupt.sh
@@ -70,10 +70,13 @@ test_expect_success "NUL in commit message's body" '
grep "a NUL byte in commit log message not allowed" err
'
-test_expect_failure "NUL in commit message's header" "
+test_expect_success "NUL in commit message's header" "
test_when_finished 'git am --abort' &&
make_mbox_with_nul subject >subject.patch &&
- test_must_fail git am subject.patch
+ test_must_fail git mailinfo msg patch <subject.patch 2>err &&
+ grep \"a NUL byte in 'Subject' is not allowed\" err &&
+ test_must_fail git am subject.patch 2>err &&
+ grep \"a NUL byte in 'Subject' is not allowed\" err
"
test_done