Skip to content

Commit 1941007

Browse files
committed
t9350: skip ISO-8859-? tests when the environment is always-UTF-8
In the BusyBox-w32 version that is currently under consideration for MinGit for Windows (to reduce the .zip size, and to avoid problems with the MSYS2 runtime), the UTF-16 environment present in Windows is considered to be authoritative, and the 8-bit version is always in UTF-8 encoding. As a consequence, the ISO-8859-? tests in t9350-fast-export (which try to set GIT_AUTHOR_NAME to a ISO-8859-? encoded value) *must* fail in that setup. So let's detect when they would fail (due to an environment being purely kept UTF-8 encoded), and skip those tests in that case. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 7513244 commit 1941007

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

t/t9350-fast-export.sh

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,12 @@ test_expect_success 'fast-export --show-original-ids | git fast-import' '
9494
test $MUSS = $(git rev-parse --verify refs/tags/muss)
9595
'
9696

97-
test_expect_success 'reencoding iso-8859-7' '
97+
test_lazy_prereq UTF8_ONLY_ENV '
98+
. "$TEST_DIRECTORY"/t3901/8859-1.txt &&
99+
! git var GIT_AUTHOR_IDENT | grep "Áéí"
100+
'
101+
102+
test_expect_success !UTF8_ONLY_ENV 'reencoding iso-8859-7' '
98103
99104
test_when_finished "git reset --hard HEAD~1" &&
100105
test_config i18n.commitencoding iso-8859-7 &&
@@ -120,7 +125,7 @@ test_expect_success 'reencoding iso-8859-7' '
120125
! grep ^encoding actual)
121126
'
122127

123-
test_expect_success 'aborting on iso-8859-7' '
128+
test_expect_success !UTF8_ONLY_ENV 'aborting on iso-8859-7' '
124129
125130
test_when_finished "git reset --hard HEAD~1" &&
126131
test_config i18n.commitencoding iso-8859-7 &&
@@ -129,7 +134,7 @@ test_expect_success 'aborting on iso-8859-7' '
129134
test_must_fail git fast-export --reencode=abort wer^..wer >iso-8859-7.fi
130135
'
131136

132-
test_expect_success 'preserving iso-8859-7' '
137+
test_expect_success !UTF8_ONLY_ENV 'preserving iso-8859-7' '
133138
134139
test_when_finished "git reset --hard HEAD~1" &&
135140
test_config i18n.commitencoding iso-8859-7 &&
@@ -151,7 +156,7 @@ test_expect_success 'preserving iso-8859-7' '
151156
grep ^encoding actual)
152157
'
153158

154-
test_expect_success 'encoding preserved if reencoding fails' '
159+
test_expect_success !UTF8_ONLY_ENV 'encoding preserved if reencoding fails' '
155160
156161
test_when_finished "git reset --hard HEAD~1" &&
157162
test_config i18n.commitencoding iso-8859-7 &&
@@ -168,6 +173,10 @@ test_expect_success 'encoding preserved if reencoding fails' '
168173
test 252 -eq "$(git cat-file -s i18n-invalid)")
169174
'
170175

176+
# The subsequent tests validate timestamps, and we may just have skipped a tick
177+
test_have_prereq !UTF8_ONLY_ENV ||
178+
test_tick
179+
171180
test_expect_success 'import/export-marks' '
172181
173182
git checkout -b marks master &&

0 commit comments

Comments
 (0)