Skip to content

Commit e7ab73f

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 aab663a commit e7ab73f

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 &&
@@ -109,7 +114,7 @@ test_expect_success 'reencoding iso-8859-7' '
109114
grep $(printf "\317\200") actual)
110115
'
111116

112-
test_expect_success 'aborting on iso-8859-7' '
117+
test_expect_success !UTF8_ONLY_ENV 'aborting on iso-8859-7' '
113118
114119
test_when_finished "git reset --hard HEAD~1" &&
115120
test_config i18n.commitencoding iso-8859-7 &&
@@ -118,7 +123,7 @@ test_expect_success 'aborting on iso-8859-7' '
118123
test_must_fail git fast-export --reencode=abort wer^..wer >iso-8859-7.fi
119124
'
120125

121-
test_expect_success 'preserving iso-8859-7' '
126+
test_expect_success !UTF8_ONLY_ENV 'preserving iso-8859-7' '
122127
123128
test_when_finished "git reset --hard HEAD~1" &&
124129
test_config i18n.commitencoding iso-8859-7 &&
@@ -132,7 +137,7 @@ test_expect_success 'preserving iso-8859-7' '
132137
grep $(printf "\360") actual)
133138
'
134139

135-
test_expect_success 'encoding preserved if reencoding fails' '
140+
test_expect_success !UTF8_ONLY_ENV 'encoding preserved if reencoding fails' '
136141
137142
test_when_finished "git reset --hard HEAD~1" &&
138143
test_config i18n.commitencoding iso-8859-7 &&
@@ -146,6 +151,10 @@ test_expect_success 'encoding preserved if reencoding fails' '
146151
grep ^encoding actual)
147152
'
148153

154+
# The subsequent tests validate timestamps, and we may just have skipped a tick
155+
test_have_prereq !UTF8_ONLY_ENV ||
156+
test_tick
157+
149158
test_expect_success 'import/export-marks' '
150159
151160
git checkout -b marks master &&

0 commit comments

Comments
 (0)