Junio C Hamano | 6bf4f1b | 2008-03-14 17:10:09 -0700 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
| 3 | test_description='format-patch mime headers and extra headers do not conflict' |
Ævar Arnfjörð Bjarmason | ab1f692 | 2022-04-13 22:01:51 +0200 | [diff] [blame] | 4 | |
| 5 | TEST_PASSES_SANITIZE_LEAK=true |
Junio C Hamano | 6bf4f1b | 2008-03-14 17:10:09 -0700 | [diff] [blame] | 6 | . ./test-lib.sh |
| 7 | |
| 8 | test_expect_success 'create commit with utf-8 body' ' |
| 9 | echo content >file && |
| 10 | git add file && |
| 11 | git commit -m one && |
| 12 | echo more >>file && |
| 13 | git commit -a -m "two |
| 14 | |
| 15 | utf-8 body: ñ" |
| 16 | ' |
| 17 | |
| 18 | test_expect_success 'patch has mime headers' ' |
| 19 | rm -f 0001-two.patch && |
| 20 | git format-patch HEAD^ && |
| 21 | grep -i "content-type: text/plain; charset=utf-8" 0001-two.patch |
| 22 | ' |
| 23 | |
| 24 | test_expect_success 'patch has mime and extra headers' ' |
| 25 | rm -f 0001-two.patch && |
| 26 | git config format.headers "x-foo: bar" && |
| 27 | git format-patch HEAD^ && |
| 28 | grep -i "x-foo: bar" 0001-two.patch && |
| 29 | grep -i "content-type: text/plain; charset=utf-8" 0001-two.patch |
| 30 | ' |
| 31 | |
| 32 | test_done |