Skip to content

Commit 02773f1

Browse files
committed
t9350: skip ISO-8859-1 test 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-1 test in t9350-fast-export (which tries to set GIT_AUTHOR_NAME to a ISO-8859-1 encoded value) *must* fail in that setup. So let's detect when it would fail (due to an environment being purely kept UTF-8 encoded), and skip that test in that case. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 7745cd0 commit 02773f1

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

t/t9350-fast-export.sh

Lines changed: 12 additions & 2 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 'iso-8859-1' '
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 'iso-8859-1' '
98103
99104
git config i18n.commitencoding ISO8859-1 &&
100105
# use author and committer name in ISO-8859-1 to match it.
@@ -110,6 +115,11 @@ test_expect_success 'iso-8859-1' '
110115
grep "Áéí óú" actual)
111116
112117
'
118+
119+
# The subsequent tests validate timestamps, and we may just have skipped a tick
120+
test_have_prereq !UTF8_ONLY_ENV ||
121+
test_tick
122+
113123
test_expect_success 'import/export-marks' '
114124
115125
git checkout -b marks master &&
@@ -224,7 +234,7 @@ GIT_COMMITTER_NAME='C O Mitter'; export GIT_COMMITTER_NAME
224234

225235
test_expect_success 'setup copies' '
226236
227-
git config --unset i18n.commitencoding &&
237+
{ git config --unset i18n.commitencoding || :; } &&
228238
git checkout -b copy rein &&
229239
git mv file file3 &&
230240
git commit -m move1 &&

0 commit comments

Comments
 (0)