X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=t%2Ft9001-send-email.sh;h=640b3d2bb41636e271d0d55aabeade38ded612bb;hb=443f26cbcac66368eb0ec8a8a250bf5815ad0a10;hp=c09f37528811f9395d63e3f3acd1f598307983a2;hpb=cc64c6970a0d50ecb75ba902d406bac7ea461f97;p=git.git diff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh index c09f37528..640b3d2bb 100755 --- a/t/t9001-send-email.sh +++ b/t/t9001-send-email.sh @@ -852,4 +852,70 @@ test_expect_success 'no warning with sendemail.chainreplyto = true' ' ! grep "no-chain-reply-to" errors ' +test_expect_success 'sendemail.to works' ' + git config --replace-all sendemail.to "Somebody " && + git send-email \ + --dry-run \ + --from="Example " \ + $patches $patches >stdout && + grep "To: Somebody " stdout +' + +test_expect_success '--no-to overrides sendemail.to' ' + git send-email \ + --dry-run \ + --from="Example " \ + --no-to \ + --to=nobody@example.com \ + $patches $patches >stdout && + grep "To: nobody@example.com" stdout && + ! grep "To: Somebody " stdout +' + +test_expect_success 'sendemail.cc works' ' + git config --replace-all sendemail.cc "Somebody " && + git send-email \ + --dry-run \ + --from="Example " \ + --to=nobody@example.com \ + $patches $patches >stdout && + grep "Cc: Somebody " stdout +' + +test_expect_success '--no-cc overrides sendemail.cc' ' + git send-email \ + --dry-run \ + --from="Example " \ + --no-cc \ + --cc=bodies@example.com \ + --to=nobody@example.com \ + $patches $patches >stdout && + grep "Cc: bodies@example.com" stdout && + ! grep "Cc: Somebody " stdout +' + +test_expect_success 'sendemail.bcc works' ' + git config --replace-all sendemail.bcc "Other " && + git send-email \ + --dry-run \ + --from="Example " \ + --to=nobody@example.com \ + --smtp-server relay.example.com \ + $patches $patches >stdout && + grep "RCPT TO:" stdout +' + +test_expect_success '--no-bcc overrides sendemail.bcc' ' + git send-email \ + --dry-run \ + --from="Example " \ + --no-bcc \ + --bcc=bodies@example.com \ + --to=nobody@example.com \ + --smtp-server relay.example.com \ + $patches $patches >stdout && + grep "RCPT TO:" stdout && + ! grep "RCPT TO:" stdout +' + test_done