Skip to content

Commit 4297485

Browse files
committed
Merge branch 'ss/format-patch-use-encode-headers-for-cover-letter'
"git format-patch --encode-email-headers" ignored the option when preparing the cover letter, which has been corrected. * ss/format-patch-use-encode-headers-for-cover-letter: format-patch: fix ignored encode_email_headers for cover letter
2 parents 340581b + 219d54a commit 4297485

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

builtin/log.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1364,6 +1364,7 @@ static void make_cover_letter(struct rev_info *rev, int use_separate_file,
13641364
pp.date_mode.type = DATE_RFC2822;
13651365
pp.rev = rev;
13661366
pp.print_email_subject = 1;
1367+
pp.encode_email_headers = rev->encode_email_headers;
13671368
pp_user_info(&pp, NULL, &sb, committer, encoding);
13681369
prepare_cover_text(&pp, description_file, branch_name, &sb,
13691370
encoding, need_8bit_cte);

t/t4014-format-patch.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1906,6 +1906,16 @@ body" &&
19061906
grep "^body$" actual
19071907
'
19081908

1909+
test_expect_success 'cover letter with --cover-from-description subject (UTF-8 subject line)' '
1910+
test_config branch.rebuild-1.description "Café?
1911+
1912+
body" &&
1913+
git checkout rebuild-1 &&
1914+
git format-patch --stdout --cover-letter --cover-from-description subject --encode-email-headers main >actual &&
1915+
grep "^Subject: \[PATCH 0/2\] =?UTF-8?q?Caf=C3=A9=3F?=$" actual &&
1916+
! grep "Café" actual
1917+
'
1918+
19091919
test_expect_success 'cover letter with format.coverFromDescription = auto (short subject line)' '
19101920
test_config branch.rebuild-1.description "config subject
19111921

0 commit comments

Comments
 (0)