Merge branch 'mh/maint-http-proxy-fix' into maint
[gitweb.git] / t / t9001-send-email.sh
index 4f6822f2c5d717edd20cb97e49fad3017d34897e..2efaed441d6ae238ce5d6a6105230e088d5e56ff 100755 (executable)
@@ -8,7 +8,7 @@ test_expect_success \
     'prepare reference tree' \
     'echo "1A quick brown fox jumps over the" >file &&
      echo "lazy dog" >>file &&
-     git add file
+     git add file &&
      GIT_AUTHOR_NAME="A" git commit -a -m "Initial."'
 
 test_expect_success \
@@ -20,9 +20,9 @@ test_expect_success \
       echo "  echo \"!\$a!\""
       echo "done >commandline"
       echo "cat > msgtxt"
-      ) >fake.sendmail
-     chmod +x ./fake.sendmail
-     git add fake.sendmail
+      ) >fake.sendmail &&
+     chmod +x ./fake.sendmail &&
+     git add fake.sendmail &&
      GIT_AUTHOR_NAME="A" git commit -a -m "Second."'
 
 test_expect_success 'Extract patches' '
@@ -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