Skip to content

Commit 86d5f7f

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 3feca04 commit 86d5f7f

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
@@ -66,7 +66,12 @@ test_expect_success 'fast-export master~2..master' '
6666
6767
'
6868

69-
test_expect_success 'iso-8859-1' '
69+
test_lazy_prereq UTF8_ONLY_ENV '
70+
. "$TEST_DIRECTORY"/t3901/8859-1.txt &&
71+
! git var GIT_AUTHOR_IDENT | grep "Áéí"
72+
'
73+
74+
test_expect_success !UTF8_ONLY_ENV 'iso-8859-1' '
7075
7176
git config i18n.commitencoding ISO8859-1 &&
7277
# use author and committer name in ISO-8859-1 to match it.
@@ -82,6 +87,11 @@ test_expect_success 'iso-8859-1' '
8287
grep "Áéí óú" actual)
8388
8489
'
90+
91+
# The subsequent tests validate timestamps, and we may just have skipped a tick
92+
test_have_prereq !UTF8_ONLY_ENV ||
93+
test_tick
94+
8595
test_expect_success 'import/export-marks' '
8696
8797
git checkout -b marks master &&
@@ -196,7 +206,7 @@ GIT_COMMITTER_NAME='C O Mitter'; export GIT_COMMITTER_NAME
196206

197207
test_expect_success 'setup copies' '
198208
199-
git config --unset i18n.commitencoding &&
209+
{ git config --unset i18n.commitencoding || :; } &&
200210
git checkout -b copy rein &&
201211
git mv file file3 &&
202212
git commit -m move1 &&

0 commit comments

Comments
 (0)