aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-03-15 00:09:20 -0700
committerJunio C Hamano <gitster@pobox.com>2008-03-15 00:09:33 -0700
commit267123b4299ea2c2f090ef169f9fc5039897cd72 (patch)
treeecbbe5be7cfd059b001af3195d71a0b9cece8c30 /t
parent2a2ad0c0007b9f79768b4564644ac9eaaa7310b6 (diff)
parent6bf4f1b4c9d78b2061bd5f3bf77bb21112b755be (diff)
downloadgit-267123b4299ea2c2f090ef169f9fc5039897cd72.tar.gz
git-267123b4299ea2c2f090ef169f9fc5039897cd72.tar.xz
Merge branch 'maint'
* maint: format-patch: generate MIME header as needed even when there is format.header
Diffstat (limited to 't')
-rwxr-xr-xt/t4021-format-patch-signer-mime.sh10
-rwxr-xr-xt/t4028-format-patch-mime-headers.sh30
2 files changed, 39 insertions, 1 deletions
diff --git a/t/t4021-format-patch-signer-mime.sh b/t/t4021-format-patch-signer-mime.sh
index 67a70fada..ba43f1854 100755
--- a/t/t4021-format-patch-signer-mime.sh
+++ b/t/t4021-format-patch-signer-mime.sh
@@ -32,11 +32,19 @@ test_expect_success 'format with signoff without funny signer name' '
test_expect_success 'format with non ASCII signer name' '
- GIT_COMMITTER_NAME="$B$O$^$N(B $B$U$K$*$&(B" \
+ GIT_COMMITTER_NAME="はまの ふにおう" \
git format-patch -s --stdout -1 >output &&
grep Content-Type output
'
+test_expect_success 'attach and signoff do not duplicate mime headers' '
+
+ GIT_COMMITTER_NAME="はまの ふにおう" \
+ git format-patch -s --stdout -1 --attach >output &&
+ test `grep -ci ^MIME-Version: output` = 1
+
+'
+
test_done
diff --git a/t/t4028-format-patch-mime-headers.sh b/t/t4028-format-patch-mime-headers.sh
new file mode 100755
index 000000000..204ba673c
--- /dev/null
+++ b/t/t4028-format-patch-mime-headers.sh
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+test_description='format-patch mime headers and extra headers do not conflict'
+. ./test-lib.sh
+
+test_expect_success 'create commit with utf-8 body' '
+ echo content >file &&
+ git add file &&
+ git commit -m one &&
+ echo more >>file &&
+ git commit -a -m "two
+
+ utf-8 body: ñ"
+'
+
+test_expect_success 'patch has mime headers' '
+ rm -f 0001-two.patch &&
+ git format-patch HEAD^ &&
+ grep -i "content-type: text/plain; charset=utf-8" 0001-two.patch
+'
+
+test_expect_success 'patch has mime and extra headers' '
+ rm -f 0001-two.patch &&
+ git config format.headers "x-foo: bar" &&
+ git format-patch HEAD^ &&
+ grep -i "x-foo: bar" 0001-two.patch &&
+ grep -i "content-type: text/plain; charset=utf-8" 0001-two.patch
+'
+
+test_done