summaryrefslogtreecommitdiff
path: root/t/t9001-send-email.sh
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2010-09-24 17:03:00 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-09-27 19:36:57 (GMT)
commit6e74e075d25aea67cf973e456a6804c0c3741235 (patch)
tree6e6d2d1249eb0039391bdfd073f48c66d6606695 /t/t9001-send-email.sh
parent9027fa9eb7df606b6658dd48a40bb993ce222ddd (diff)
downloadgit-6e74e075d25aea67cf973e456a6804c0c3741235.zip
git-6e74e075d25aea67cf973e456a6804c0c3741235.tar.gz
git-6e74e075d25aea67cf973e456a6804c0c3741235.tar.bz2
git-send-email.perl: Add --to-cmd
Add the ability to use a command line --to-cmd=cmd to create the list of "To:" addresses. Used a shared routine for --cc-cmd and --to-cmd. Did not use IPC::Open2, leaving that for Ævar if ever he decides to fix the other bugs he might find. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t9001-send-email.sh')
-rwxr-xr-xt/t9001-send-email.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh
index 71b3df9..36cf421 100755
--- a/t/t9001-send-email.sh
+++ b/t/t9001-send-email.sh
@@ -201,6 +201,24 @@ test_expect_success $PREREQ 'Prompting works' '
grep "^To: to@example.com\$" msgtxt1
'
+test_expect_success $PREREQ 'tocmd works' '
+ clean_fake_sendmail &&
+ cp $patches tocmd.patch &&
+ echo tocmd--tocmd@example.com >>tocmd.patch &&
+ {
+ echo "#!$SHELL_PATH"
+ echo sed -n -e s/^tocmd--//p \"\$1\"
+ } > tocmd-sed &&
+ chmod +x tocmd-sed &&
+ git send-email \
+ --from="Example <nobody@example.com>" \
+ --to-cmd=./tocmd-sed \
+ --smtp-server="$(pwd)/fake.sendmail" \
+ tocmd.patch \
+ &&
+ grep "^To: tocmd@example.com" msgtxt1
+'
+
test_expect_success $PREREQ 'cccmd works' '
clean_fake_sendmail &&
cp $patches cccmd.patch &&