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