Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

Commit e87bf95

Browse files
kasaldscho
authored andcommitted
t4041, t7102: do not pass iso8859-1 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). Fix t4041, t7102 and update an older fix in t4205. Thanks-to: Karsten Blees <[email protected]>
1 parent 8fd105f commit e87bf95

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

t/t4041-diff-submodule-option.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,10 @@ add_file () {
2323
echo "$name" >"$name" &&
2424
git add "$name" &&
2525
test_tick &&
26-
msg_added_iso88591=$(echo "Add $name ($added $name)" | iconv -f utf-8 -t iso8859-1) &&
27-
git -c 'i18n.commitEncoding=iso8859-1' commit -m "$msg_added_iso88591"
26+
# "git commit -m" would break MinGW, as Windows refuse to pass
27+
# iso8859-1 encoded parameter to git.
28+
echo "Add $name ($added $name)" | iconv -f utf-8 -t iso8859-1 |
29+
git -c 'i18n.commitEncoding=iso8859-1' commit -F -
2830
done >/dev/null &&
2931
git rev-parse --short --verify HEAD
3032
)

t/t4205-log-pretty-formats.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,9 @@ test_expect_success 'set up basic repos' '
2828
git add foo &&
2929
test_tick &&
3030
git config i18n.commitEncoding iso8859-1 &&
31-
commit_msg iso8859-1 > commit_msg &&
32-
git commit --file commit_msg &&
31+
# "git commit -m" would break MinGW, as Windows refuse to pass
32+
# iso8859-1 encoded parameter to git.
33+
commit_msg iso8859-1 | git commit -F - &&
3334
git add bar &&
3435
test_tick &&
3536
git commit -m "add bar" &&

t/t7102-reset.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ test_expect_success 'creating initial files and commits' '
4141
4242
echo "1st line 2nd file" >secondfile &&
4343
echo "2nd line 2nd file" >>secondfile &&
44-
git -c "i18n.commitEncoding=iso8859-1" commit -a -m "$(commit_msg iso8859-1)" &&
44+
# "git commit -m" would break MinGW, as Windows refuse to pass
45+
# iso8859-1 encoded parameter to git.
46+
commit_msg iso8859-1 | git -c "i18n.commitEncoding=iso8859-1" commit -a -F - &&
4547
head5=$(git rev-parse --verify HEAD)
4648
'
4749
# git log --pretty=oneline # to see those SHA1 involved
@@ -331,7 +333,9 @@ test_expect_success 'redoing the last two commits should succeed' '
331333
332334
echo "1st line 2nd file" >secondfile &&
333335
echo "2nd line 2nd file" >>secondfile &&
334-
git -c "i18n.commitEncoding=iso8859-1" commit -a -m "$(commit_msg iso8859-1)" &&
336+
# "git commit -m" would break MinGW, as Windows refuse to pass
337+
# iso8859-1 encoded parameter to git.
338+
commit_msg iso8859-1 | git -c "i18n.commitEncoding=iso8859-1" commit -a -F - &&
335339
check_changes $head5
336340
'
337341

0 commit comments

Comments
 (0)