| 1 | #!/bin/sh |
| 2 | |
| 3 | test_description='format-patch mime headers and extra headers do not conflict' |
| 4 | |
| 5 | . ./test-lib.sh |
| 6 | |
| 7 | test_expect_success 'create commit with utf-8 body' ' |
| 8 | echo content >file && |
| 9 | git add file && |
| 10 | git commit -m one && |
| 11 | echo more >>file && |
| 12 | git commit -a -m "two |
| 13 | |
| 14 | utf-8 body: ñ" |
| 15 | ' |
| 16 | |
| 17 | test_expect_success 'patch has mime headers' ' |
| 18 | rm -f 0001-two.patch && |
| 19 | git format-patch HEAD^ && |
| 20 | grep -i "content-type: text/plain; charset=utf-8" 0001-two.patch |
| 21 | ' |
| 22 | |
| 23 | test_expect_success 'patch has mime and extra headers' ' |
| 24 | rm -f 0001-two.patch && |
| 25 | git config format.headers "x-foo: bar" && |
| 26 | git format-patch HEAD^ && |
| 27 | grep -i "x-foo: bar" 0001-two.patch && |
| 28 | grep -i "content-type: text/plain; charset=utf-8" 0001-two.patch |
| 29 | ' |
| 30 | |
| 31 | test_done |