diff options
author | Junio C Hamano <gitster@pobox.com> | 2023-11-07 04:26:44 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-11-07 04:26:44 +0300 |
commit | 00f372e2a419266fc9a41cb7b7935c9217e05ca7 (patch) | |
tree | 873c5a9e5c012207d17fbe304596d46eee2d5002 /t/t9001-send-email.sh | |
parent | dbffe54f8a49b167ebe44eee57a40b29dcb4871a (diff) | |
parent | 0d8647034e4c1647d850cb4a3bb1ea56fd4c3f32 (diff) |
Merge branch 'ms/send-email-validate-fix'
"git send-email" did not have certain pieces of data computed yet
when it tried to validate the outging messages and its recipient
addresses, which has been sorted out.
* ms/send-email-validate-fix:
send-email: move validation code below process_address_list
Diffstat (limited to 't/t9001-send-email.sh')
-rwxr-xr-x | t/t9001-send-email.sh | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh index 2e8e8137fb..dc7785eadb 100755 --- a/t/t9001-send-email.sh +++ b/t/t9001-send-email.sh @@ -633,6 +633,25 @@ test_expect_success $PREREQ "--validate respects absolute core.hooksPath path" ' test_cmp expect actual ' +test_expect_success $PREREQ "--validate hook supports multiple addresses in arguments" ' + hooks_path="$(pwd)/my-hooks" && + test_config core.hooksPath "$hooks_path" && + test_when_finished "rm my-hooks.ran" && + test_must_fail git send-email \ + --from="Example <nobody@example.com>" \ + --to=nobody@example.com,abc@example.com \ + --smtp-server="$(pwd)/fake.sendmail" \ + --validate \ + longline.patch 2>actual && + test_path_is_file my-hooks.ran && + cat >expect <<-EOF && + fatal: longline.patch: rejected by sendemail-validate hook + fatal: command '"'"'git hook run --ignore-missing sendemail-validate -- <patch> <header>'"'"' died with exit code 1 + warning: no patches were sent + EOF + test_cmp expect actual +' + test_expect_success $PREREQ "--validate hook supports header argument" ' write_script my-hooks/sendemail-validate <<-\EOF && if test "$#" -ge 2 |