Skip to content

Commit e6ce2be

Browse files
patthoytsgitster
authored andcommitted
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>
1 parent 0217569 commit e6ce2be

File tree

4 files changed

+13
-7
lines changed

4 files changed

+13
-7
lines changed

t/t4041-diff-submodule-option.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,10 @@ add_file () {
2626
echo "$name" >"$name" &&
2727
git add "$name" &&
2828
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 -
3133
done >/dev/null &&
3234
git rev-parse --short --verify HEAD
3335
)

t/t4205-log-pretty-formats.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ test_expect_success 'set up basic repos' '
3131
git add foo &&
3232
test_tick &&
3333
git config i18n.commitEncoding $test_encoding &&
34-
git commit -m "$(commit_msg $test_encoding)" &&
34+
commit_msg $test_encoding | git commit -F - &&
3535
git add bar &&
3636
test_tick &&
3737
git commit -m "add bar" &&

t/t6006-rev-list-format.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ test_expect_success 'setup' '
3535
: >foo &&
3636
git add foo &&
3737
git config i18n.commitEncoding $test_encoding &&
38-
git commit -m "$added_iso88591" &&
38+
echo "$added_iso88591" | git commit -F - &&
3939
head1=$(git rev-parse --verify HEAD) &&
4040
head1_short=$(git rev-parse --verify --short $head1) &&
4141
tree1=$(git rev-parse --verify HEAD:) &&
4242
tree1_short=$(git rev-parse --verify --short $tree1) &&
4343
echo "$changed" > foo &&
44-
git commit -a -m "$changed_iso88591" &&
44+
echo "$changed_iso88591" | git commit -a -F - &&
4545
head2=$(git rev-parse --verify HEAD) &&
4646
head2_short=$(git rev-parse --verify --short $head2) &&
4747
tree2=$(git rev-parse --verify HEAD:) &&

t/t7102-reset.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ test_expect_success 'creating initial files and commits' '
4444
4545
echo "1st line 2nd file" >secondfile &&
4646
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 - &&
4850
head5=$(git rev-parse --verify HEAD)
4951
'
5052
# git log --pretty=oneline # to see those SHA1 involved
@@ -334,7 +336,9 @@ test_expect_success 'redoing the last two commits should succeed' '
334336
335337
echo "1st line 2nd file" >secondfile &&
336338
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 - &&
338342
check_changes $head5
339343
'
340344

0 commit comments

Comments
 (0)