format_sanitized_subject: Don't trim past initial length of strbuf
[git/raj.git] / t / t4028-format-patch-mime-headers.sh
blob204ba673cb58f905f2f35ff5b83294b2a2943f48
1 #!/bin/sh
3 test_description='format-patch mime headers and extra headers do not conflict'
4 . ./test-lib.sh
6 test_expect_success 'create commit with utf-8 body' '
7 echo content >file &&
8 git add file &&
9 git commit -m one &&
10 echo more >>file &&
11 git commit -a -m "two
13 utf-8 body: ñ"
16 test_expect_success 'patch has mime headers' '
17 rm -f 0001-two.patch &&
18 git format-patch HEAD^ &&
19 grep -i "content-type: text/plain; charset=utf-8" 0001-two.patch
22 test_expect_success 'patch has mime and extra headers' '
23 rm -f 0001-two.patch &&
24 git config format.headers "x-foo: bar" &&
25 git format-patch HEAD^ &&
26 grep -i "x-foo: bar" 0001-two.patch &&
27 grep -i "content-type: text/plain; charset=utf-8" 0001-two.patch
30 test_done