aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorDaniel Barkalow <barkalow@iabervon.org>2008-02-19 02:40:28 -0500
committerJunio C Hamano <gitster@pobox.com>2008-02-19 21:49:38 -0800
commita8d8173e6c7ff85627377389e40844ec71206f5e (patch)
tree4a2c2d625f20483516b6d7fa36139ba60babd27a /t
parenta5a27c79b7e77e28462b6d089e827391b67d3e5f (diff)
downloadgit-a8d8173e6c7ff85627377389e40844ec71206f5e.tar.gz
git-a8d8173e6c7ff85627377389e40844ec71206f5e.tar.xz
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 <barkalow@iabervon.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t4014-format-patch.sh34
1 files changed, 34 insertions, 0 deletions
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 <rcipient@example.com>
+" &&
+ git config --add format.headers "Cc: S. E. Cipient <scipient@example.com>
+" &&
+ git format-patch --stdout master..side > patch2 &&
+ sed -e "/^$/Q" patch2 > hdrs2 &&
+ grep "^To: R. E. Cipient <rcipient@example.com>$" hdrs2 &&
+ grep "^Cc: S. E. Cipient <scipient@example.com>$" hdrs2
+
+'
+
+test_expect_failure 'extra headers without newlines' '
+
+ git config --replace-all format.headers "To: R. E. Cipient <rcipient@example.com>" &&
+ git config --add format.headers "Cc: S. E. Cipient <scipient@example.com>" &&
+ git format-patch --stdout master..side >patch3 &&
+ sed -e "/^$/Q" patch3 > hdrs3 &&
+ grep "^To: R. E. Cipient <rcipient@example.com>$" hdrs3 &&
+ grep "^Cc: S. E. Cipient <scipient@example.com>$" hdrs3
+
+'
+
+test_expect_failure 'extra headers with multiple To:s' '
+
+ git config --replace-all format.headers "To: R. E. Cipient <rcipient@example.com>" &&
+ git config --add format.headers "To: S. E. Cipient <scipient@example.com>" &&
+ git format-patch --stdout master..side > patch4 &&
+ sed -e "/^$/Q" patch4 > hdrs4 &&
+ grep "^To: R. E. Cipient <rcipient@example.com>,$" hdrs4 &&
+ grep "^ *S. E. Cipient <scipient@example.com>$" hdrs4
+'
+
test_expect_success 'multiple files' '
rm -rf patches/ &&