summaryrefslogtreecommitdiff
path: root/t/t9001-send-email.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-10-26 20:14:53 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-10-26 20:14:53 (GMT)
commitbdcaebbedd54eeaf430ad1e4093a07922fe656d9 (patch)
treeb1724441036be9be5f3f71c03382c709cf70d984 /t/t9001-send-email.sh
parent24cfb6ff58d849201de35c87663b83affd1b7f72 (diff)
parentdcfafc5214e6af277aa8565af4f63b20046d65bf (diff)
downloadgit-bdcaebbedd54eeaf430ad1e4093a07922fe656d9.zip
git-bdcaebbedd54eeaf430ad1e4093a07922fe656d9.tar.gz
git-bdcaebbedd54eeaf430ad1e4093a07922fe656d9.tar.bz2
Merge branch 'mm/send-email-cc-cruft-after-address'
"git send-email" attempts to pick up valid e-mails from the trailers, but people in real world write non-addresses there, like "Cc: Stable <add@re.ss> # 4.8+", which broke the output depending on the availability and vintage of Mail::Address perl module. * mm/send-email-cc-cruft-after-address: Git.pm: add comment pointing to t9000 t9000-addresses: update expected results after fix parse_mailboxes: accept extra text after <...> address
Diffstat (limited to 't/t9001-send-email.sh')
-rwxr-xr-xt/t9001-send-email.sh29
1 files changed, 29 insertions, 0 deletions
diff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh
index b3355d2..3dc4a34 100755
--- a/t/t9001-send-email.sh
+++ b/t/t9001-send-email.sh
@@ -140,6 +140,35 @@ 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!
+!five@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> # this is part of the name
+ Cc: <three@example.com>, <four@example.com> # not.five@example.com
+ Cc: "Some # Body" <five@example.com> [part.of.name.too]
+ 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