summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ce90301)
raw | patch | inline | side by side (parent: ce90301)
author | Junio C Hamano <junkio@cox.net> | |
Tue, 30 May 2006 06:53:13 +0000 (23:53 -0700) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Tue, 30 May 2006 07:09:36 +0000 (00:09 -0700) |
This makes t9001 test happy. Also fixes the warning on
uninitialized $references variable again.
Signed-off-by: Junio C Hamano <junkio@cox.net>
uninitialized $references variable again.
Signed-off-by: Junio C Hamano <junkio@cox.net>
git-send-email.perl | patch | blob | history | |
t/t9001-send-email.sh | patch | blob | history |
diff --git a/git-send-email.perl b/git-send-email.perl
index d418d6c5d2230fde2e201d31ff82dc5e26e79a9a..0e368fff0cd6158108012b53eeb88496cc0a0632 100755 (executable)
--- a/git-send-email.perl
+++ b/git-send-email.perl
my $pid = open my $sm, '|-';
defined $pid or die $!;
if (!$pid) {
- exec($smtp_server,'-i',@recipients) or die $!;
+ exec($smtp_server,'-i',
+ map { scalar extract_valid_address($_) }
+ @recipients) or die $!;
}
print $sm "$header\n$message";
close $sm or die $?;
}
$reply_to = $initial_reply_to;
-$references = $initial_reply_to;
+$references = $initial_reply_to || '';
make_message_id();
$subject = $initial_subject;
diff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh
index 276cbac3ba0a863ff0292d19c75e2ff8f844c740..a61da1efbdb6ac547c1d1167a4caa849b1ee4f9b 100755 (executable)
--- a/t/t9001-send-email.sh
+++ b/t/t9001-send-email.sh
test_expect_success \
'Setup helper tool' \
- 'echo "#!/bin/sh" > fake.sendmail
- echo "shift" >> fake.sendmail
- echo "echo \"\$*\" > commandline" >> fake.sendmail
- echo "cat > msgtxt" >> fake.sendmail
+ '(echo "#!/bin/sh"
+ echo shift
+ echo for a
+ echo do
+ echo " echo \"!\$a!\""
+ echo "done >commandline"
+ echo "cat > msgtxt"
+ ) >fake.sendmail
chmod +x ./fake.sendmail
git add fake.sendmail
GIT_AUTHOR_NAME="A" git commit -a -m "Second."'
'git format-patch -n HEAD^1
git send-email -from="Example <nobody@example.com>" --to=nobody@example.com --smtp-server="$(pwd)/fake.sendmail" ./0001*txt'
+cat >expected <<\EOF
+!nobody@example.com!
+!author@example.com!
+EOF
test_expect_success \
'Verify commandline' \
- 'cline=$(cat commandline)
- [ "$cline" == "nobody@example.com author@example.com" ]'
+ 'diff commandline expected'
test_done