-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'mt/send-email-cover-to-cc'
* mt/send-email-cover-to-cc: t9001: avoid non-portable '\n' with sed test/send-email: to-cover, cc-cover tests git-send-email: two new options: to-cover, cc-cover
- Loading branch information
Showing
3 changed files
with
73 additions
and
0 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 |
---|---|---|
|
@@ -1334,6 +1334,51 @@ test_expect_success $PREREQ '--force sends cover letter template anyway' ' | |
test -n "$(ls msgtxt*)" | ||
' | ||
|
||
test_cover_addresses () { | ||
header="$1" | ||
shift | ||
clean_fake_sendmail && | ||
rm -fr outdir && | ||
git format-patch --cover-letter -2 -o outdir && | ||
cover=`echo outdir/0000-*.patch` && | ||
mv $cover cover-to-edit.patch && | ||
perl -pe "s/^From:/$header: extra\@address.com\nFrom:/" cover-to-edit.patch >"$cover" && | ||
git send-email \ | ||
--force \ | ||
--from="Example <[email protected]>" \ | ||
--no-to --no-cc \ | ||
"$@" \ | ||
--smtp-server="$(pwd)/fake.sendmail" \ | ||
outdir/0000-*.patch \ | ||
outdir/0001-*.patch \ | ||
outdir/0002-*.patch \ | ||
2>errors >out && | ||
grep "^$header: [email protected]" msgtxt1 >to1 && | ||
grep "^$header: [email protected]" msgtxt2 >to2 && | ||
grep "^$header: [email protected]" msgtxt3 >to3 && | ||
test_line_count = 1 to1 && | ||
test_line_count = 1 to2 && | ||
test_line_count = 1 to3 | ||
} | ||
|
||
test_expect_success $PREREQ 'to-cover adds To to all mail' ' | ||
test_cover_addresses "To" --to-cover | ||
' | ||
|
||
test_expect_success $PREREQ 'cc-cover adds Cc to all mail' ' | ||
test_cover_addresses "Cc" --cc-cover | ||
' | ||
|
||
test_expect_success $PREREQ 'tocover adds To to all mail' ' | ||
test_config sendemail.tocover true && | ||
test_cover_addresses "To" | ||
' | ||
|
||
test_expect_success $PREREQ 'cccover adds Cc to all mail' ' | ||
test_config sendemail.cccover true && | ||
test_cover_addresses "Cc" | ||
' | ||
|
||
test_expect_success $PREREQ 'sendemail.aliasfiletype=mailrc' ' | ||
clean_fake_sendmail && | ||
echo "alias sbd [email protected]" >.mailrc && | ||
|