-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'jk/send-email-fix-addresses-from-composed-messages' int…
…o next The codepath to handle recipient addresses `git send-email --compose` learns from the user was completely broken, which has been corrected. * jk/send-email-fix-addresses-from-composed-messages: send-email: handle to/cc/bcc from --compose message Revert "send-email: extract email-parsing code into a subroutine" doc/send-email: mention handling of "reply-to" with --compose
- Loading branch information
Showing
3 changed files
with
99 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2505,4 +2505,45 @@ test_expect_success $PREREQ 'test forbidSendmailVariables behavior override' ' | |
HEAD^ | ||
' | ||
|
||
test_expect_success $PREREQ '--compose handles lowercase headers' ' | ||
write_script fake-editor <<-\EOF && | ||
sed "s/^From:.*/from: [email protected]/i" "$1" >"$1.tmp" && | ||
mv "$1.tmp" "$1" | ||
EOF | ||
clean_fake_sendmail && | ||
git send-email \ | ||
--compose \ | ||
--from="Example <[email protected]>" \ | ||
[email protected] \ | ||
--smtp-server="$(pwd)/fake.sendmail" \ | ||
HEAD^ && | ||
grep "From: [email protected]" msgtxt1 | ||
' | ||
|
||
test_expect_success $PREREQ '--compose handles to headers' ' | ||
write_script fake-editor <<-\EOF && | ||
sed "s/^To: .*/&, [email protected]/" <"$1" >"$1.tmp" && | ||
echo this is the body >>"$1.tmp" && | ||
mv "$1.tmp" "$1" | ||
EOF | ||
clean_fake_sendmail && | ||
GIT_SEND_EMAIL_NOTTY=1 \ | ||
git send-email \ | ||
--compose \ | ||
--from="Example <[email protected]>" \ | ||
[email protected] \ | ||
--smtp-server="$(pwd)/fake.sendmail" \ | ||
HEAD^ && | ||
# Check both that the cover letter used our modified "to" line, | ||
# but also that it was picked up for the patch. | ||
q_to_tab >expect <<-\EOF && | ||
To: [email protected], | ||
[email protected] | ||
EOF | ||
grep -A1 "^To:" msgtxt1 >msgtxt1.to && | ||
test_cmp expect msgtxt1.to && | ||
grep -A1 "^To:" msgtxt2 >msgtxt2.to && | ||
test_cmp expect msgtxt2.to | ||
' | ||
|
||
test_done |