@@ -1299,6 +1299,49 @@ test_expect_success $PREREQ 'utf8 sender is not duplicated' '
1299
1299
test_line_count = 1 msgfrom
1300
1300
'
1301
1301
1302
+ test_expect_success $PREREQ ' setup expect for cc list' "
1303
+ cat >expected-cc <<\EOF
1304
+
1305
+
1306
+
1307
+
1308
+
1309
+
1310
+
1311
+
1312
+ EOF
1313
+ "
1314
+
1315
+ test_expect_success $PREREQ ' cc list is sanitized' '
1316
+ clean_fake_sendmail &&
1317
+ test_commit weird_cc_body &&
1318
+ test_when_finished "git reset --hard HEAD^" &&
1319
+ git commit --amend -F - <<-EOF &&
1320
+ Test Cc: sanitization.
1321
+
1322
+ Cc: Person, One <[email protected] >
1323
+ Cc: Ronnie O${SQ}Sullivan <[email protected] >
1324
+ Reviewed-by: Füñný Nâmé <[email protected] >
1325
+ Reported-by: bugger on Jira
1326
+ Reported-by: Douglas Reporter <[email protected] > [from Jira profile]
1327
+ BugID: 12345
1328
+ Co-developed-by: "C. O. Developer" <[email protected] >
1329
+ Signed-off-by: A. U. Thor <[email protected] >
1330
+ EOF
1331
+ git send-email -1 [email protected] \
1332
+ --smtp-server="$(pwd)/fake.sendmail" >actual-show-all-headers &&
1333
+ test_cmp expected-cc commandline1 &&
1334
+ test_grep "^(body) Adding cc: \"Person, One\" <[email protected] >" actual-show-all-headers &&
1335
+ test_grep "^(body) Adding cc: Ronnie O${SQ}Sullivan <[email protected] >" actual-show-all-headers &&
1336
+ test_grep "^(body) Adding cc: =?UTF-8?q?F=C3=BC=C3=B1n=C3=BD=20N=C3=A2m=C3=A9?="\
1337
+ " <[email protected] >" actual-show-all-headers &&
1338
+ test_grep "^(body) Ignoring Reported-by .* bugger on Jira" actual-show-all-headers &&
1339
+ test_grep "^(body) Adding cc: Douglas Reporter <[email protected] >" actual-show-all-headers &&
1340
+ test_grep ! "12345" actual-show-all-headers &&
1341
+ test_grep "^(body) Adding cc: \"C. O. Developer\" <[email protected] >" actual-show-all-headers &&
1342
+ test_grep "^(body) Adding cc: \"A. U. Thor\" <[email protected] >" actual-show-all-headers
1343
+ '
1344
+
1302
1345
test_expect_success $PREREQ ' sendemail.composeencoding works' '
1303
1346
clean_fake_sendmail &&
1304
1347
git config sendemail.composeencoding iso-8859-1 &&
0 commit comments