Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2021-03-31 00:35:37 +0300
committerJunio C Hamano <gitster@pobox.com>2021-03-31 00:35:37 +0300
commit1ba947cf15c66d96ee5793d3b94c9eb80361aa66 (patch)
tree320e2a10fadd8984374ba2255a27442ba9154c5c /t
parentdc2a073036ccbd3d8aa707b98e996b6fb9bcd751 (diff)
parentc8243933c74e0bebcc617f750ae3990ecca47759 (diff)
Merge branch 'rf/send-email-hookspath'
"git send-email" learned to honor the core.hooksPath configuration. * rf/send-email-hookspath: git-send-email: Respect core.hooksPath setting
Diffstat (limited to 't')
-rwxr-xr-xt/t9001-send-email.sh32
1 files changed, 32 insertions, 0 deletions
diff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh
index 4eee9c3dcb..1a1caf8f2e 100755
--- a/t/t9001-send-email.sh
+++ b/t/t9001-send-email.sh
@@ -513,6 +513,38 @@ do
done
+test_expect_success $PREREQ "--validate respects relative core.hooksPath path" '
+ clean_fake_sendmail &&
+ mkdir my-hooks &&
+ test_when_finished "rm my-hooks.ran" &&
+ write_script my-hooks/sendemail-validate <<-\EOF &&
+ >my-hooks.ran
+ exit 1
+ EOF
+ test_config core.hooksPath "my-hooks" &&
+ test_must_fail git send-email \
+ --from="Example <nobody@example.com>" \
+ --to=nobody@example.com \
+ --smtp-server="$(pwd)/fake.sendmail" \
+ --validate \
+ longline.patch 2>err &&
+ test_path_is_file my-hooks.ran &&
+ grep "rejected by sendemail-validate" err
+'
+
+test_expect_success $PREREQ "--validate respects absolute core.hooksPath path" '
+ test_config core.hooksPath "$(pwd)/my-hooks" &&
+ test_when_finished "rm my-hooks.ran" &&
+ test_must_fail git send-email \
+ --from="Example <nobody@example.com>" \
+ --to=nobody@example.com \
+ --smtp-server="$(pwd)/fake.sendmail" \
+ --validate \
+ longline.patch 2>err &&
+ test_path_is_file my-hooks.ran &&
+ grep "rejected by sendemail-validate" err
+'
+
for enc in 7bit 8bit quoted-printable base64
do
test_expect_success $PREREQ "--transfer-encoding=$enc produces correct header" '