summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJay Soffian <jaysoffian@gmail.com>2008-02-22 00:16:04 (GMT)
committerJunio C Hamano <gitster@pobox.com>2008-02-22 05:25:49 (GMT)
commit0fb7fc751d29cd1099556f71fc7c08158a6a78bc (patch)
tree5168e978572e7f9f73803f1961fd0ab58e2d114e /t
parentf5ed3b30e0091421408a0119fa75148955c4fc6a (diff)
downloadgit-0fb7fc751d29cd1099556f71fc7c08158a6a78bc.zip
git-0fb7fc751d29cd1099556f71fc7c08158a6a78bc.tar.gz
git-0fb7fc751d29cd1099556f71fc7c08158a6a78bc.tar.bz2
send-email: fix In-Reply-To regression
Fix a regression introduced by 1ca3d6e (send-email: squelch warning due to comparing undefined $_ to "") where if the user was prompted for an initial In-Reply-To and didn't provide one, messages would be sent out with an invalid In-Reply-To of "<>" Also add test cases for the regression and the fix. A small modification was needed to allow send-email to take its replies from stdin if the environment variable GIT_SEND_EMAIL_NOTTY is set. Signed-off-by: Jay Soffian <jaysoffian@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t9001-send-email.sh21
1 files changed, 21 insertions, 0 deletions
diff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh
index 08f7c3d..2efaed4 100755
--- a/t/t9001-send-email.sh
+++ b/t/t9001-send-email.sh
@@ -108,4 +108,25 @@ test_expect_success 'allow long lines with --no-validate' '
2>errors
'
+test_expect_success 'Invalid In-Reply-To' '
+ git send-email \
+ --from="Example <nobody@example.com>" \
+ --to=nobody@example.com \
+ --in-reply-to=" " \
+ --smtp-server="$(pwd)/fake.sendmail" \
+ $patches
+ 2>errors
+ ! grep "^In-Reply-To: < *>" msgtxt
+'
+
+test_expect_success 'Valid In-Reply-To when prompting' '
+ (echo "From Example <from@example.com>"
+ echo "To Example <to@example.com>"
+ echo ""
+ ) | env GIT_SEND_EMAIL_NOTTY=1 git send-email \
+ --smtp-server="$(pwd)/fake.sendmail" \
+ $patches 2>errors &&
+ ! grep "^In-Reply-To: < *>" msgtxt
+'
+
test_done