diff options
Diffstat (limited to 't')
-rwxr-xr-x | t/t9001-send-email.sh | 30 |
1 files changed, 10 insertions, 20 deletions
diff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh index 37caa183e0..c9f54d5a5e 100755 --- a/t/t9001-send-email.sh +++ b/t/t9001-send-email.sh @@ -817,26 +817,25 @@ test_expect_success $PREREQ '--confirm=compose' ' test_confirm --confirm=compose --compose ' -test_expect_success $PREREQ 'confirm by default (due to cc)' ' +save_confirm () { CONFIRM=$(git config --get sendemail.confirm) && + test_when_finished "git config sendemail.confirm ${CONFIRM:-never}" +} + +test_expect_success $PREREQ 'confirm by default (due to cc)' ' + save_confirm && git config --unset sendemail.confirm && test_confirm - ret="$?" - git config sendemail.confirm ${CONFIRM:-never} - test $ret = "0" ' test_expect_success $PREREQ 'confirm by default (due to --compose)' ' - CONFIRM=$(git config --get sendemail.confirm) && + save_confirm && git config --unset sendemail.confirm && test_confirm --suppress-cc=all --compose - ret="$?" - git config sendemail.confirm ${CONFIRM:-never} - test $ret = "0" ' test_expect_success $PREREQ 'confirm detects EOF (inform assumes y)' ' - CONFIRM=$(git config --get sendemail.confirm) && + save_confirm && git config --unset sendemail.confirm && rm -fr outdir && git format-patch -2 -o outdir && @@ -846,13 +845,10 @@ test_expect_success $PREREQ 'confirm detects EOF (inform assumes y)' ' --to=nobody@example.com \ --smtp-server="$(pwd)/fake.sendmail" \ outdir/*.patch </dev/null - ret="$?" - git config sendemail.confirm ${CONFIRM:-never} - test $ret = "0" ' test_expect_success $PREREQ 'confirm detects EOF (auto causes failure)' ' - CONFIRM=$(git config --get sendemail.confirm) && + save_confirm && git config sendemail.confirm auto && GIT_SEND_EMAIL_NOTTY=1 && export GIT_SEND_EMAIL_NOTTY && @@ -861,13 +857,10 @@ test_expect_success $PREREQ 'confirm detects EOF (auto causes failure)' ' --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 $PREREQ 'confirm does not loop forever' ' - CONFIRM=$(git config --get sendemail.confirm) && + save_confirm && git config sendemail.confirm auto && GIT_SEND_EMAIL_NOTTY=1 && export GIT_SEND_EMAIL_NOTTY && @@ -876,9 +869,6 @@ test_expect_success $PREREQ 'confirm does not loop forever' ' --to=nobody@example.com \ --smtp-server="$(pwd)/fake.sendmail" \ $patches - ret="$?" - git config sendemail.confirm ${CONFIRM:-never} - test $ret = "0" ' test_expect_success $PREREQ 'utf8 Cc is rfc2047 encoded' ' |