]> Kevux Git Server - rit/commit
send-email: move validation code below process_address_list
authorMichael Strawbridge <michael.strawbridge@amd.com>
Wed, 25 Oct 2023 18:51:29 +0000 (14:51 -0400)
committerJunio C Hamano <gitster@pobox.com>
Thu, 26 Oct 2023 12:46:10 +0000 (21:46 +0900)
commit0d8647034e4c1647d850cb4a3bb1ea56fd4c3f32
tree6bce7090d95b27f73617c2efa6b6c4911b523b18
parentfb7d80edcae482f4fa5d4be0227dc3054734e5f3
send-email: move validation code below process_address_list

Move validation logic below processing of email address lists so that
email validation gets the proper email addresses.  As a side effect,
some initialization needed to be moved down.  In order for validation
and the actual email sending to have the same initial state, the
initialized variables that get modified by pre_process_file are
encapsulated in a new function.

This fixes email address validation errors when the optional
perl module Email::Valid is installed and multiple addresses are passed
in on a single to/cc argument like --to=foo@example.com,bar@example.com.
A new test was added to t9001 to expose failures with this case in the
future.

Reported-by: Bagas Sanjaya <bagasdotme@gmail.com>
Signed-off-by: Michael Strawbridge <michael.strawbridge@amd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-send-email.perl
t/t9001-send-email.sh