Junio C Hamano | aacb8f1 | 2007-11-02 17:55:31 -0700 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
| 3 | test_description='format-patch -s should force MIME encoding as needed' |
| 4 | |
| 5 | . ./test-lib.sh |
| 6 | |
| 7 | test_expect_success setup ' |
| 8 | |
| 9 | >F && |
| 10 | git add F && |
| 11 | git commit -m initial && |
| 12 | echo new line >F && |
| 13 | |
| 14 | test_tick && |
| 15 | git commit -m "This adds some lines to F" F |
| 16 | |
| 17 | ' |
| 18 | |
| 19 | test_expect_success 'format normally' ' |
| 20 | |
| 21 | git format-patch --stdout -1 >output && |
| 22 | ! grep Content-Type output |
| 23 | |
| 24 | ' |
| 25 | |
| 26 | test_expect_success 'format with signoff without funny signer name' ' |
| 27 | |
| 28 | git format-patch -s --stdout -1 >output && |
| 29 | ! grep Content-Type output |
| 30 | |
| 31 | ' |
| 32 | |
| 33 | test_expect_success 'format with non ASCII signer name' ' |
| 34 | |
Junio C Hamano | 6bf4f1b | 2008-03-14 17:10:09 -0700 | [diff] [blame] | 35 | GIT_COMMITTER_NAME="はまの ふにおう" \ |
Junio C Hamano | aacb8f1 | 2007-11-02 17:55:31 -0700 | [diff] [blame] | 36 | git format-patch -s --stdout -1 >output && |
| 37 | grep Content-Type output |
| 38 | |
| 39 | ' |
| 40 | |
Junio C Hamano | 6bf4f1b | 2008-03-14 17:10:09 -0700 | [diff] [blame] | 41 | test_expect_success 'attach and signoff do not duplicate mime headers' ' |
| 42 | |
| 43 | GIT_COMMITTER_NAME="はまの ふにおう" \ |
| 44 | git format-patch -s --stdout -1 --attach >output && |
Elia Pinto | 20cb28b | 2014-04-30 09:23:01 -0700 | [diff] [blame] | 45 | test $(grep -ci ^MIME-Version: output) = 1 |
Junio C Hamano | 6bf4f1b | 2008-03-14 17:10:09 -0700 | [diff] [blame] | 46 | |
| 47 | ' |
| 48 | |
Junio C Hamano | aacb8f1 | 2007-11-02 17:55:31 -0700 | [diff] [blame] | 49 | test_done |
| 50 | |