]> asedeno.scripts.mit.edu Git - git.git/blobdiff - t/t4014-format-patch.sh
Merge branch 'mh/maint-http-proxy-fix'
[git.git] / t / t4014-format-patch.sh
index ac78752067ef69844fc9b171a02d151a81b56958..16aa99dc0dbe1fe7e09aa046dfc2dc1ec652963c 100755 (executable)
@@ -88,6 +88,48 @@ 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_success '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_success '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 'additional command line cc' '
+
+       git config --replace-all format.headers "Cc: R. E. Cipient <rcipient@example.com>" &&
+       git format-patch --cc="S. E. Cipient <scipient@example.com>" --stdout master..side | sed -e "/^$/q" >patch5 &&
+       grep "^Cc: R. E. Cipient <rcipient@example.com>,$" patch5 &&
+       grep "^ *S. E. Cipient <scipient@example.com>$" patch5
+'
+
 test_expect_success 'multiple files' '
 
        rm -rf patches/ &&