tests: do not pass iso8859-1 encoded parameter
git commit -m with some iso8859-1 encoded stuff is doomed to fail in MinGW, because Windows don't let you pass encoded bytes to a process (CreateProcessW always takes a UTF-16LE encoded string). It is safe to pass the iso8859-1 message using a file or a pipe. Thanks-to: Karsten Blees <blees@dcon.de> Author: Stepan Kasal <kasal@ucw.cz> Signed-off-by: Stepan Kasal <kasal@ucw.cz> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Pat Thoyts committed
Sep 2, 2013 at 15:44 UTC
e6ce2be2d7a70dfa3241f70ae236da4a63625ef8
4 files changed
+13
-7
t/t4041-diff-submodule-option.sh
+4
-2
@@ -26,8 +26,10 @@ add_file () {
26
echo "$name" >"$name" &&
27
git add "$name" &&
28
test_tick &&
29
- msg_added_iso88591=$(echo "Add $name ($added $name)" | iconv -f utf-8 -t $test_encoding) &&
30
- git -c "i18n.commitEncoding=$test_encoding" commit -m "$msg_added_iso88591"
29
+ # "git commit -m" would break MinGW, as Windows refuse to pass
30
+ # $test_encoding encoded parameter to git.
31
+ echo "Add $name ($added $name)" | iconv -f utf-8 -t $test_encoding |
32
+ git -c "i18n.commitEncoding=$test_encoding" commit -F -
33
done >/dev/null &&
34
git rev-parse --short --verify HEAD
35
)
t/t4205-log-pretty-formats.sh
+1
-1
@@ -31,7 +31,7 @@ test_expect_success 'set up basic repos' '
31
git add foo &&
32
test_tick &&
33
git config i18n.commitEncoding $test_encoding &&
34
- git commit -m "$(commit_msg $test_encoding)" &&
34
+ commit_msg $test_encoding | git commit -F - &&
35
git add bar &&
36
test_tick &&
37
git commit -m "add bar" &&
t/t6006-rev-list-format.sh
+2
-2
@@ -35,13 +35,13 @@ test_expect_success 'setup' '
35
: >foo &&
36
git add foo &&
37
git config i18n.commitEncoding $test_encoding &&
38
- git commit -m "$added_iso88591" &&
38
+ echo "$added_iso88591" | git commit -F - &&
39
head1=$(git rev-parse --verify HEAD) &&
40
head1_short=$(git rev-parse --verify --short $head1) &&
41
tree1=$(git rev-parse --verify HEAD:) &&
42
tree1_short=$(git rev-parse --verify --short $tree1) &&
43
echo "$changed" > foo &&
44
- git commit -a -m "$changed_iso88591" &&
44
+ echo "$changed_iso88591" | git commit -a -F - &&
45
head2=$(git rev-parse --verify HEAD) &&
46
head2_short=$(git rev-parse --verify --short $head2) &&
47
tree2=$(git rev-parse --verify HEAD:) &&
t/t7102-reset.sh
+6
-2
@@ -44,7 +44,9 @@ test_expect_success 'creating initial files and commits' '
44
45
echo "1st line 2nd file" >secondfile &&
46
echo "2nd line 2nd file" >>secondfile &&
47
- git -c "i18n.commitEncoding=$test_encoding" commit -a -m "$(commit_msg $test_encoding)" &&
47
+ # "git commit -m" would break MinGW, as Windows refuse to pass
48
+ # $test_encoding encoded parameter to git.
49
+ commit_msg $test_encoding | git -c "i18n.commitEncoding=$test_encoding" commit -a -F - &&
50
head5=$(git rev-parse --verify HEAD)
51
'
52
# git log --pretty=oneline # to see those SHA1 involved
@@ -334,7 +336,9 @@ test_expect_success 'redoing the last two commits should succeed' '
336
337
echo "1st line 2nd file" >secondfile &&
338
echo "2nd line 2nd file" >>secondfile &&
337
- git -c "i18n.commitEncoding=$test_encoding" commit -a -m "$(commit_msg $test_encoding)" &&
339
+ # "git commit -m" would break MinGW, as Windows refuse to pass
340
+ # $test_encoding encoded parameter to git.
341
+ commit_msg $test_encoding | git -c "i18n.commitEncoding=$test_encoding" commit -a -F - &&
342
check_changes $head5
343
'
344