X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=t%2Ft4014-format-patch.sh;h=f87434b9f8e0d520813389e6ea7c94f74222767b;hb=0d1d6e50cf3401874b50b77aa1dc0e33357a1556;hp=d21c37f3a20c42b05044e45c5e5af71294c8420c;hpb=d5cff17edaf438bbf45a2130e9cadc0c938291d6;p=git.git diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh index d21c37f3a..f87434b9f 100755 --- a/t/t4014-format-patch.sh +++ b/t/t4014-format-patch.sh @@ -613,4 +613,56 @@ test_expect_success 'format-patch --ignore-if-in-upstream HEAD' ' git format-patch --ignore-if-in-upstream HEAD ' +test_expect_success 'format-patch --signature' ' + git format-patch --stdout --signature="my sig" -1 >output && + grep "my sig" output +' + +test_expect_success 'format-patch with format.signature config' ' + git config format.signature "config sig" && + git format-patch --stdout -1 >output && + grep "config sig" output +' + +test_expect_success 'format-patch --signature overrides format.signature' ' + git config format.signature "config sig" && + git format-patch --stdout --signature="overrides" -1 >output && + ! grep "config sig" output && + grep "overrides" output +' + +test_expect_success 'format-patch --no-signature ignores format.signature' ' + git config format.signature "config sig" && + git format-patch --stdout --signature="my sig" --no-signature \ + -1 >output && + ! grep "config sig" output && + ! grep "my sig" output && + ! grep "^-- \$" output +' + +test_expect_success 'format-patch --signature --cover-letter' ' + git config --unset-all format.signature && + git format-patch --stdout --signature="my sig" --cover-letter \ + -1 >output && + grep "my sig" output && + test 2 = $(grep "my sig" output | wc -l) +' + +test_expect_success 'format.signature="" supresses signatures' ' + git config format.signature "" && + git format-patch --stdout -1 >output && + ! grep "^-- \$" output +' + +test_expect_success 'format-patch --no-signature supresses signatures' ' + git config --unset-all format.signature && + git format-patch --stdout --no-signature -1 >output && + ! grep "^-- \$" output +' + +test_expect_success 'format-patch --signature="" supresses signatures' ' + git format-patch --signature="" -1 >output && + ! grep "^-- \$" output +' + test_done