From: Daniel Barkalow Date: Tue, 19 Feb 2008 07:40:28 +0000 (-0500) Subject: Add tests for extra headers in format-patch X-Git-Tag: v1.5.5-rc0~134^2~6 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=a8d8173e6c7ff85627377389e40844ec71206f5e;p=git.git Add tests for extra headers in format-patch Presently, it works with each header ending with a newline, but not without the newlines. Also add a test to see that multiple "To:" headers get combined. Signed-off-by: Daniel Barkalow Signed-off-by: Junio C Hamano --- diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh index ac7875206..28ab7b9a5 100755 --- a/t/t4014-format-patch.sh +++ b/t/t4014-format-patch.sh @@ -88,6 +88,40 @@ test_expect_success 'replay did not screw up the log message' ' ' +test_expect_success 'extra headers' ' + + git config format.headers "To: R. E. Cipient +" && + git config --add format.headers "Cc: S. E. Cipient +" && + git format-patch --stdout master..side > patch2 && + sed -e "/^$/Q" patch2 > hdrs2 && + grep "^To: R. E. Cipient $" hdrs2 && + grep "^Cc: S. E. Cipient $" hdrs2 + +' + +test_expect_failure 'extra headers without newlines' ' + + git config --replace-all format.headers "To: R. E. Cipient " && + git config --add format.headers "Cc: S. E. Cipient " && + git format-patch --stdout master..side >patch3 && + sed -e "/^$/Q" patch3 > hdrs3 && + grep "^To: R. E. Cipient $" hdrs3 && + grep "^Cc: S. E. Cipient $" hdrs3 + +' + +test_expect_failure 'extra headers with multiple To:s' ' + + git config --replace-all format.headers "To: R. E. Cipient " && + git config --add format.headers "To: S. E. Cipient " && + git format-patch --stdout master..side > patch4 && + sed -e "/^$/Q" patch4 > hdrs4 && + grep "^To: R. E. Cipient ,$" hdrs4 && + grep "^ *S. E. Cipient $" hdrs4 +' + test_expect_success 'multiple files' ' rm -rf patches/ &&