From 86d5f7fc482f7761853d3bd92fc28643c5709122 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Sat, 8 Jul 2017 21:49:12 +0200 Subject: [PATCH] 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 --- t/t9350-fast-export.sh | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/t/t9350-fast-export.sh b/t/t9350-fast-export.sh index 6d6d5050a2..cd85f24dd7 100755 --- a/t/t9350-fast-export.sh +++ b/t/t9350-fast-export.sh @@ -66,7 +66,12 @@ test_expect_success 'fast-export master~2..master' ' ' -test_expect_success 'iso-8859-1' ' +test_lazy_prereq UTF8_ONLY_ENV ' + . "$TEST_DIRECTORY"/t3901/8859-1.txt && + ! git var GIT_AUTHOR_IDENT | grep "Áéí" +' + +test_expect_success !UTF8_ONLY_ENV 'iso-8859-1' ' git config i18n.commitencoding ISO8859-1 && # use author and committer name in ISO-8859-1 to match it. @@ -82,6 +87,11 @@ test_expect_success 'iso-8859-1' ' grep "Áéí óú" actual) ' + +# The subsequent tests validate timestamps, and we may just have skipped a tick +test_have_prereq !UTF8_ONLY_ENV || +test_tick + test_expect_success 'import/export-marks' ' git checkout -b marks master && @@ -196,7 +206,7 @@ GIT_COMMITTER_NAME='C O Mitter'; export GIT_COMMITTER_NAME test_expect_success 'setup copies' ' - git config --unset i18n.commitencoding && + { git config --unset i18n.commitencoding || :; } && git checkout -b copy rein && git mv file file3 && git commit -m move1 &&