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

Commit 0c28f80

Browse files
kbleeskasal
authored andcommitted
MinGW: disable legacy encoding tests
On Windows, all native APIs are Unicode-based. It is impossible to pass legacy encoded byte arrays to a process via command line or environment variables. Disable the tests that try to do so. In t3901, most tests still work if we don't mess up the repository encoding in setup, so don't switch to ISO-8859-1 on MinGW. Note that i18n tests that do their encoding tricks via encoded files (such as t3900) are not affected by this. Signed-off-by: Karsten Blees <[email protected]>
1 parent 480cd59 commit 0c28f80

File tree

3 files changed

+18
-15
lines changed

3 files changed

+18
-15
lines changed

t/t3901-i18n-patch.sh

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,13 @@ test_expect_success setup '
5454
git add yours &&
5555
git commit -s -m "Second on side" &&
5656
57-
# the second one on the side branch is ISO-8859-1
58-
git config i18n.commitencoding ISO8859-1 &&
59-
# use author and committer name in ISO-8859-1 to match it.
60-
. "$TEST_DIRECTORY"/t3901-8859-1.txt &&
57+
if test_have_prereq NOT_MINGW
58+
then
59+
# the second one on the side branch is ISO-8859-1
60+
git config i18n.commitencoding ISO8859-1 &&
61+
# use author and committer name in ISO-8859-1 to match it.
62+
. "$TEST_DIRECTORY"/t3901-8859-1.txt
63+
fi &&
6164
test_tick &&
6265
echo Yet another >theirs &&
6366
git add theirs &&
@@ -119,7 +122,7 @@ test_expect_success 'rebase (U/L)' '
119122
check_encoding 2
120123
'
121124

122-
test_expect_success 'rebase (L/L)' '
125+
test_expect_success NOT_MINGW 'rebase (L/L)' '
123126
# In this test we want ISO-8859-1 encoded commits as the result
124127
git config i18n.commitencoding ISO8859-1 &&
125128
git config i18n.logoutputencoding ISO8859-1 &&
@@ -131,7 +134,7 @@ test_expect_success 'rebase (L/L)' '
131134
check_encoding 2 8859
132135
'
133136

134-
test_expect_success 'rebase (L/U)' '
137+
test_expect_success NOT_MINGW 'rebase (L/U)' '
135138
# This is pathological -- use UTF-8 as intermediate form
136139
# to get ISO-8859-1 results.
137140
git config i18n.commitencoding ISO8859-1 &&
@@ -159,7 +162,7 @@ test_expect_success 'cherry-pick(U/U)' '
159162
check_encoding 3
160163
'
161164

162-
test_expect_success 'cherry-pick(L/L)' '
165+
test_expect_success NOT_MINGW 'cherry-pick(L/L)' '
163166
# Both the commitencoding and logoutputencoding is set to ISO-8859-1
164167
165168
git config i18n.commitencoding ISO8859-1 &&
@@ -189,7 +192,7 @@ test_expect_success 'cherry-pick(U/L)' '
189192
check_encoding 3
190193
'
191194

192-
test_expect_success 'cherry-pick(L/U)' '
195+
test_expect_success NOT_MINGW 'cherry-pick(L/U)' '
193196
# Again, the commitencoding is set to ISO-8859-1 but
194197
# logoutputencoding is set to UTF-8.
195198

t/t4201-shortlog.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ test_expect_success 'output from user-defined format is re-wrapped' '
9393
test_cmp expect log.predictable
9494
'
9595

96-
test_expect_success 'shortlog wrapping' '
96+
test_expect_success NOT_MINGW 'shortlog wrapping' '
9797
cat >expect <<\EOF &&
9898
A U Thor (5):
9999
Test
@@ -114,7 +114,7 @@ EOF
114114
test_cmp expect out
115115
'
116116

117-
test_expect_success 'shortlog from non-git directory' '
117+
test_expect_success NOT_MINGW 'shortlog from non-git directory' '
118118
git log HEAD >log &&
119119
GIT_DIR=non-existing git shortlog -w <log >out &&
120120
test_cmp expect out
@@ -159,7 +159,7 @@ $DSCHO (2):
159159
160160
EOF
161161

162-
test_expect_success 'shortlog encoding' '
162+
test_expect_success NOT_MINGW 'shortlog encoding' '
163163
git reset --hard "$commit" &&
164164
git config --unset i18n.commitencoding &&
165165
echo 2 > a1 &&

t/t8005-blame-i18n.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ author $SJIS_NAME
3333
summary $SJIS_MSG
3434
EOF
3535

36-
test_expect_success \
36+
test_expect_success NOT_MINGW \
3737
'blame respects i18n.commitencoding' '
3838
git blame --incremental file | \
3939
egrep "^(author|summary) " > actual &&
@@ -49,7 +49,7 @@ author $EUC_JAPAN_NAME
4949
summary $EUC_JAPAN_MSG
5050
EOF
5151

52-
test_expect_success \
52+
test_expect_success NOT_MINGW \
5353
'blame respects i18n.logoutputencoding' '
5454
git config i18n.logoutputencoding eucJP &&
5555
git blame --incremental file | \
@@ -66,7 +66,7 @@ author $UTF8_NAME
6666
summary $UTF8_MSG
6767
EOF
6868

69-
test_expect_success \
69+
test_expect_success NOT_MINGW \
7070
'blame respects --encoding=UTF-8' '
7171
git blame --incremental --encoding=UTF-8 file | \
7272
egrep "^(author|summary) " > actual &&
@@ -82,7 +82,7 @@ author $UTF8_NAME
8282
summary $UTF8_MSG
8383
EOF
8484

85-
test_expect_success \
85+
test_expect_success NOT_MINGW \
8686
'blame respects --encoding=none' '
8787
git blame --incremental --encoding=none file | \
8888
egrep "^(author|summary) " > actual &&

0 commit comments

Comments
 (0)