summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6e18251)
raw | patch | inline | side by side (parent: 6e18251)
author | Jay Soffian <jaysoffian@gmail.com> | |
Sun, 29 Mar 2009 01:39:11 +0000 (21:39 -0400) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 30 Mar 2009 04:41:28 +0000 (21:41 -0700) |
Signed-off-by: Jay Soffian <jaysoffian@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t9001-send-email.sh | patch | blob | history |
diff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh
index e426c96fb7d0f72b2822d4379b7fa671a04ab733..b4de98c1f2a3d56858744dab4a06d96a30acdb81 100755 (executable)
--- a/t/t9001-send-email.sh
+++ b/t/t9001-send-email.sh
--from="Example <nobody@example.com>" \
--to=nobody@example.com \
--smtp-server="$(pwd)/fake.sendmail" \
- $@ \
- $patches | grep "Send this email"
+ $@ $patches > stdout &&
+ grep "Send this email" stdout
}
test_expect_success '--confirm=always' '
test_expect_success 'confirm by default (due to cc)' '
CONFIRM=$(git config --get sendemail.confirm) &&
git config --unset sendemail.confirm &&
- test_confirm &&
- git config sendemail.confirm $CONFIRM
+ test_confirm
+ ret="$?"
+ git config sendemail.confirm ${CONFIRM:-never}
+ test $ret = "0"
'
test_expect_success 'confirm by default (due to --compose)' '
test $ret = "0"
'
+test_expect_success 'confirm detects EOF (inform assumes y)' '
+ CONFIRM=$(git config --get sendemail.confirm) &&
+ git config --unset sendemail.confirm &&
+ GIT_SEND_EMAIL_NOTTY=1 \
+ git send-email \
+ --from="Example <nobody@example.com>" \
+ --to=nobody@example.com \
+ --smtp-server="$(pwd)/fake.sendmail" \
+ $patches < /dev/null
+ ret="$?"
+ git config sendemail.confirm ${CONFIRM:-never}
+ test $ret = "0"
+'
+
+test_expect_success 'confirm detects EOF (auto causes failure)' '
+ CONFIRM=$(git config --get sendemail.confirm) &&
+ git config sendemail.confirm auto &&
+ GIT_SEND_EMAIL_NOTTY=1 \
+ test_must_fail git send-email \
+ --from="Example <nobody@example.com>" \
+ --to=nobody@example.com \
+ --smtp-server="$(pwd)/fake.sendmail" \
+ $patches < /dev/null
+ ret="$?"
+ git config sendemail.confirm ${CONFIRM:-never}
+ test $ret = "0"
+'
+
+test_expect_success 'confirm doesnt loop forever' '
+ CONFIRM=$(git config --get sendemail.confirm) &&
+ git config sendemail.confirm auto &&
+ yes "bogus" | GIT_SEND_EMAIL_NOTTY=1 \
+ test_must_fail git send-email \
+ --from="Example <nobody@example.com>" \
+ --to=nobody@example.com \
+ --smtp-server="$(pwd)/fake.sendmail" \
+ $patches
+ ret="$?"
+ git config sendemail.confirm ${CONFIRM:-never}
+ test $ret = "0"
+'
+
test_expect_success '--compose adds MIME for utf8 body' '
clean_fake_sendmail &&
(echo "#!$SHELL_PATH" &&