From 214a5f2e0c86843c5f86494583792cbf3eaf89de Mon Sep 17 00:00:00 2001 From: "Brian M. Carlson" Date: Sat, 3 Aug 2013 17:26:31 +0000 Subject: [PATCH 1/2] Add missing test file for UTF-16. The test file that the UTF-16 rejection test looks for is missing, but this went unnoticed because the test is expected to fail anyway; as a consequence, the test fails because the file containing the commit message is missing, and not because the test file contains a NUL byte. Fix this by including a sample text file containing a commit message encoded in UTF-16. Signed-off-by: Brian M. Carlson Tested-by: Duy Nguyen Signed-off-by: Junio C Hamano --- t/t3900/UTF-16.txt | Bin 0 -> 146 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 t/t3900/UTF-16.txt diff --git a/t/t3900/UTF-16.txt b/t/t3900/UTF-16.txt new file mode 100644 index 0000000000000000000000000000000000000000..2257f05a992a4b9500f6ff33752cbdf8fb58c99d GIT binary patch literal 146 zcmW-aJqmbjKEzFY?FCi}po-doQaNvlX zuj<&j$Vh~SS#Fd&>8^}o3xQtzWRNy5zCGpzu|P`62Tv_HZgu?B*(r7K7qg7DI9e@K J`p+qB@d1eo8QA~; literal 0 HcmV?d00001 From 0ed45a1cd6571ed89a09791730a9089e932b7c1f Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Mon, 5 Aug 2013 09:47:11 -0700 Subject: [PATCH 2/2] t3900: test rejecting log message with NULs correctly It is not like that our longer term desire is to someday start accept log messages with NULs in them, so it is wrong to mark a test that demonstrates "git commit" that correctly fails given such an input as "expect-failure". "git commit" should fail today, and it should fail the same way in the future given a message with NUL in it. Signed-off-by: Junio C Hamano --- t/t3900-i18n-commit.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/t/t3900-i18n-commit.sh b/t/t3900-i18n-commit.sh index d48a7c002..a9e56629d 100755 --- a/t/t3900-i18n-commit.sh +++ b/t/t3900-i18n-commit.sh @@ -34,9 +34,9 @@ test_expect_success 'no encoding header for base case' ' test z = "z$E" ' -test_expect_failure 'UTF-16 refused because of NULs' ' +test_expect_success 'UTF-16 refused because of NULs' ' echo UTF-16 >F && - git commit -a -F "$TEST_DIRECTORY"/t3900/UTF-16.txt + test_must_fail git commit -a -F "$TEST_DIRECTORY"/t3900/UTF-16.txt '