From: Alex Bennée <[email protected]>

We had a regression that broke Linux's get_maintainer.pl. Using
Mail::Address to parse email addresses fixed it, but let's protect
against future regressions.

Patch-edited-by: Matthieu Moy <[email protected]>
Signed-off-by: Alex Bennée <[email protected]>
Signed-off-by: Matthieu Moy <[email protected]>
---
Change since v1: fixed proposed by Eric Sunshine and pointed out by
Alex Bennée.

Eric pointed out that using --cc-cmd=$(pwd)/expected-cc-script.sh did
not work because $(pwd) had spaces in it, but I already turned it into
./expected-cc-script.sh.

 t/t9001-send-email.sh | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh
index 4d261c2..d13d8c3 100755
--- a/t/t9001-send-email.sh
+++ b/t/t9001-send-email.sh
@@ -172,6 +172,26 @@ test_expect_success $PREREQ 'cc trailer with various 
syntax' '
        test_cmp expected-cc commandline1
 '
 
+test_expect_success $PREREQ 'setup fake get_maintainer.pl script for cc 
trailer' "
+       write_script expected-cc-script.sh <<-EOF &&
+       echo 'One Person <[email protected]> (supporter:THIS (FOO/bar))'
+       echo 'Two Person <[email protected]> (maintainer:THIS THING)'
+       echo 'Third List <[email protected]> (moderated list:THIS THING 
(FOO/bar))'
+       echo '<[email protected]> (moderated list:FOR THING)'
+       echo '[email protected] (open list:FOR THING (FOO/bar))'
+       echo '[email protected] (open list)'
+       EOF
+       chmod +x expected-cc-script.sh
+"
+
+test_expect_success $PREREQ 'cc trailer with get_maintainer.pl output' '
+       clean_fake_sendmail &&
+       git send-email -1 [email protected] \
+               --cc-cmd="./expected-cc-script.sh" \
+               --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
-- 
2.7.4

Reply via email to