X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=t%2Ft4014-format-patch.sh;h=d21c37f3a20c42b05044e45c5e5af71294c8420c;hb=4c926b37c21a088163871bb8e6ccdfc4b4952e34;hp=f2a2aaa2b9c7fd84634bb74febb3f0f5ac1793e1;hpb=d16a5dafdcec037631a5453ca7923992ce27a151;p=git.git diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh index f2a2aaa2b..d21c37f3a 100755 --- a/t/t4014-format-patch.sh +++ b/t/t4014-format-patch.sh @@ -143,6 +143,58 @@ test_expect_success 'configuration headers and command line headers' ' grep "^ *S. E. Cipient \$" patch7 ' +test_expect_success 'command line To: header' ' + + git config --unset-all format.headers && + git format-patch --to="R. E. Cipient " --stdout master..side | sed -e "/^\$/q" >patch8 && + grep "^To: R. E. Cipient \$" patch8 +' + +test_expect_success 'configuration To: header' ' + + git config format.to "R. E. Cipient " && + git format-patch --stdout master..side | sed -e "/^\$/q" >patch9 && + grep "^To: R. E. Cipient \$" patch9 +' + +test_expect_success '--no-to overrides config.to' ' + + git config --replace-all format.to \ + "R. E. Cipient " && + git format-patch --no-to --stdout master..side | + sed -e "/^\$/q" >patch10 && + ! grep "^To: R. E. Cipient \$" patch10 +' + +test_expect_success '--no-to and --to replaces config.to' ' + + git config --replace-all format.to \ + "Someone " && + git format-patch --no-to --to="Someone Else " \ + --stdout master..side | + sed -e "/^\$/q" >patch11 && + ! grep "^To: Someone \$" patch11 && + grep "^To: Someone Else \$" patch11 +' + +test_expect_success '--no-cc overrides config.cc' ' + + git config --replace-all format.cc \ + "C. E. Cipient " && + git format-patch --no-cc --stdout master..side | + sed -e "/^\$/q" >patch12 && + ! grep "^Cc: C. E. Cipient \$" patch12 +' + +test_expect_success '--no-add-headers overrides config.headers' ' + + git config --replace-all format.headers \ + "Header1: B. E. Cipient " && + git format-patch --no-add-headers --stdout master..side | + sed -e "/^\$/q" >patch13 && + ! grep "^Header1: B. E. Cipient \$" patch13 +' + test_expect_success 'multiple files' ' rm -rf patches/ && @@ -557,4 +609,8 @@ test_expect_success 'format-patch -- ' ' ! grep "Use .--" error ' +test_expect_success 'format-patch --ignore-if-in-upstream HEAD' ' + git format-patch --ignore-if-in-upstream HEAD +' + test_done