X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=t%2Ft9001-send-email.sh;h=4f6822f2c5d717edd20cb97e49fad3017d34897e;hb=7fec10b7f41fa32e71aa6377bd04cd7c6fb419e0;hp=659f9c758fd9abbae8aa657a4729059335dd92cd;hpb=d6e09883f20f13c7e2da75225f4563ea9587e20b;p=git.git diff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh index 659f9c758..4f6822f2c 100755 --- a/t/t9001-send-email.sh +++ b/t/t9001-send-email.sh @@ -78,4 +78,34 @@ test_expect_success 'Show all headers' ' diff -u expected-show-all-headers actual-show-all-headers ' +z8=zzzzzzzz +z64=$z8$z8$z8$z8$z8$z8$z8$z8 +z512=$z64$z64$z64$z64$z64$z64$z64$z64 +test_expect_success 'reject long lines' ' + rm -f commandline && + cp $patches longline.patch && + echo $z512$z512 >>longline.patch && + ! git send-email \ + --from="Example " \ + --to=nobody@example.com \ + --smtp-server="$(pwd)/fake.sendmail" \ + $patches longline.patch \ + 2>errors && + grep longline.patch errors +' + +test_expect_success 'no patch was sent' ' + ! test -e commandline +' + +test_expect_success 'allow long lines with --no-validate' ' + git send-email \ + --from="Example " \ + --to=nobody@example.com \ + --smtp-server="$(pwd)/fake.sendmail" \ + --no-validate \ + $patches longline.patch \ + 2>errors +' + test_done