fsck: add a simple test for receive.fsck.<msg-id>
[gitweb.git] / t / t9001-send-email.sh
index 7be14a4e37f7843d9a9863a21e9181ffeceee11b..a3663da49ba075c14d6aa66c3cd3d9eb0c7d2f62 100755 (executable)
@@ -1537,7 +1537,7 @@ test_expect_success $PREREQ 'sendemail.aliasfiletype=mailrc' '
 
 test_expect_success $PREREQ 'sendemail.aliasfile=~/.mailrc' '
        clean_fake_sendmail &&
-       echo "alias sbd  someone@example.org" >~/.mailrc &&
+       echo "alias sbd  someone@example.org" >"$HOME/.mailrc" &&
        git config --replace-all sendemail.aliasesfile "~/.mailrc" &&
        git config sendemail.aliasfiletype mailrc &&
        git send-email \
@@ -1549,6 +1549,33 @@ test_expect_success $PREREQ 'sendemail.aliasfile=~/.mailrc' '
        grep "^!someone@example\.org!$" commandline1
 '
 
+test_expect_success $PREREQ 'sendemail.aliasfiletype=sendmail' '
+       clean_fake_sendmail && rm -fr outdir &&
+       git format-patch -1 -o outdir &&
+       cat >>.tmp-email-aliases <<-\EOF &&
+       alice: Alice W Land <awol@example.com>
+       bob: Robert Bobbyton <bob@example.com>
+       # this is a comment
+          # this is also a comment
+       chloe: chloe@example.com
+       abgroup: alice, bob
+       bcgrp: bob, chloe, Other <o@example.com>
+       EOF
+       git config --replace-all sendemail.aliasesfile \
+               "$(pwd)/.tmp-email-aliases" &&
+       git config sendemail.aliasfiletype sendmail &&
+       git send-email \
+               --from="Example <nobody@example.com>" \
+               --to=alice --to=bcgrp \
+               --smtp-server="$(pwd)/fake.sendmail" \
+               outdir/0001-*.patch \
+               2>errors >out &&
+       grep "^!awol@example\.com!$" commandline1 &&
+       grep "^!bob@example\.com!$" commandline1 &&
+       grep "^!chloe@example\.com!$" commandline1 &&
+       grep "^!o@example\.com!$" commandline1
+'
+
 do_xmailer_test () {
        expected=$1 params=$2 &&
        git format-patch -1 &&