From 47c95e77d158e4660dab25b9fdd6f4d70013b430 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Tue, 5 Jan 2021 20:42:39 +0100 Subject: [PATCH] mktag tests: stress test whitespace handling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add tests for a couple of whitespace edge cases around the header/body boundary. I consider the requirement for a blank line before the empty body a bug, it's a long-standing regression which goes against the command's documented behavior. This bug will be addressed in a follow-up change. Signed-off-by: Ævar Arnfjörð Bjarmason Signed-off-by: Junio C Hamano --- t/t3800-mktag.sh | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/t/t3800-mktag.sh b/t/t3800-mktag.sh index 048000cda9..661b62f091 100755 --- a/t/t3800-mktag.sh +++ b/t/t3800-mktag.sh @@ -337,6 +337,42 @@ EOF check_verify_failure 'detect invalid header entry' \ '^error: char.*: trailing garbage in tag header$' +cat >tag.sig < 1206478233 -0500 + + +this line comes after an extra newline +EOF + +test_expect_success 'allow extra newlines at start of body' ' + git mktag tag.sig < 1206478233 -0500 + +EOF + +test_expect_success 'require a blank line before an empty body (1)' ' + git mktag tag.sig < 1206478233 -0500 +EOF + +check_verify_failure 'require a blank line before an empty body (2)' \ + '^error: char.*: trailing garbage in tag header$' + ############################################################ # 24. create valid tag