is_ntfs_dotgit: match other .git files
[gitweb.git] / t / t9001-send-email.sh
index b3355d2c7016e55e99a465414f230569c3807230..60a80f60b2685c461f80cdbf4256eb17dc18b85b 100755 (executable)
@@ -50,7 +50,7 @@ test_no_confirm () {
                --smtp-server="$(pwd)/fake.sendmail" \
                $@ \
                $patches >stdout &&
-               test_must_fail grep "Send this email" stdout &&
+               ! grep "Send this email" stdout &&
                >no_confirm_okay
 }
 
@@ -140,6 +140,34 @@ test_expect_success $PREREQ 'Verify commandline' '
        test_cmp expected commandline1
 '
 
+test_expect_success $PREREQ 'setup expect for cc trailer' "
+cat >expected-cc <<\EOF
+!recipient@example.com!
+!author@example.com!
+!one@example.com!
+!two@example.com!
+!three@example.com!
+!four@example.com!
+EOF
+"
+
+test_expect_success $PREREQ 'cc trailer with various syntax' '
+       test_commit cc-trailer &&
+       test_when_finished "git reset --hard HEAD^" &&
+       git commit --amend -F - <<-EOF &&
+       Test Cc: trailers.
+
+       Cc: one@example.com
+       Cc: <two@example.com> # trailing comments are ignored
+       Cc: <three@example.com>, <not.four@example.com> one address per line
+       Cc: "Some # Body" <four@example.com> [ <also.a.comment> ]
+       EOF
+       clean_fake_sendmail &&
+       git send-email -1 --to=recipient@example.com \
+               --smtp-server="$(pwd)/fake.sendmail" &&
+       test_cmp expected-cc commandline1
+'
+
 test_expect_success $PREREQ 'setup expect' "
 cat >expected-show-all-headers <<\EOF
 0001-Second.patch