summaryrefslogtreecommitdiff
path: root/t/t9001-send-email.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2020-08-18 00:02:41 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-08-18 00:02:41 (GMT)
commita00bda2b2fa5e6a8b224734cf72bb0601cd65b8a (patch)
tree07f392959e2fe6511f298998671facbd0d8be73c /t/t9001-send-email.sh
parent5676db26129bf18e77bb821d832b44c022dc9f47 (diff)
parentdd84e528a34c3822e7ab0473a95e411665b37681 (diff)
downloadgit-a00bda2b2fa5e6a8b224734cf72bb0601cd65b8a.zip
git-a00bda2b2fa5e6a8b224734cf72bb0601cd65b8a.tar.gz
git-a00bda2b2fa5e6a8b224734cf72bb0601cd65b8a.tar.bz2
Merge branch 'dd/send-email-config'
Stop when "sendmail.*" configuration variables are defined, which could be a mistaken attempt to define "sendemail.*" variables. * dd/send-email-config: git-send-email: die if sendmail.* config is set
Diffstat (limited to 't/t9001-send-email.sh')
-rwxr-xr-xt/t9001-send-email.sh29
1 files changed, 29 insertions, 0 deletions
diff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh
index 3d68570..a08f725 100755
--- a/t/t9001-send-email.sh
+++ b/t/t9001-send-email.sh
@@ -2142,4 +2142,33 @@ test_expect_success $PREREQ 'test that send-email works outside a repo' '
"$(pwd)/0001-add-master.patch"
'
+test_expect_success $PREREQ 'test that sendmail config is rejected' '
+ test_config sendmail.program sendmail &&
+ test_must_fail git send-email \
+ --from="Example <nobody@example.com>" \
+ --to=nobody@example.com \
+ --smtp-server="$(pwd)/fake.sendmail" \
+ HEAD^ 2>err &&
+ test_i18ngrep "found configuration options for '"'"sendmail"'"'" err
+'
+
+test_expect_success $PREREQ 'test that sendmail config rejection is specific' '
+ test_config resendmail.program sendmail &&
+ git send-email \
+ --from="Example <nobody@example.com>" \
+ --to=nobody@example.com \
+ --smtp-server="$(pwd)/fake.sendmail" \
+ HEAD^
+'
+
+test_expect_success $PREREQ 'test forbidSendmailVariables behavior override' '
+ test_config sendmail.program sendmail &&
+ test_config sendemail.forbidSendmailVariables false &&
+ git send-email \
+ --from="Example <nobody@example.com>" \
+ --to=nobody@example.com \
+ --smtp-server="$(pwd)/fake.sendmail" \
+ HEAD^
+'
+
test_done