From: Patrick Steinhardt Date: Wed, 18 Feb 2026 04:38:42 GMT Subject: [PATCH v3 5/5] t6006: don't use iconv(1) without ICONV prereq Message-ID: <20260218-b4-pks-ci-msvc-iconv-fixes-v3-5-08c1ff3ffc9a@pks.im> In-Reply-To: <20260218-b4-pks-ci-msvc-iconv-fixes-v3-0-08c1ff3ffc9a@pks.im> Two tests in t6006 depend on the iconv(1) prerequisite to reencode a commit message. This executable may not even exist though in case the prereq is not set, which will cause the tests to fail. Fix this by using UTF-8 instead when the prereq is not set. Signed-off-by: Patrick Steinhardt --- t/t6006-rev-list-format.sh | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/t/t6006-rev-list-format.sh b/t/t6006-rev-list-format.sh index eb93d68d7d..581984467d 100755 --- a/t/t6006-rev-list-format.sh +++ b/t/t6006-rev-list-format.sh @@ -378,15 +378,23 @@ test_expect_success 'rev-list %C(auto,...) respects --color' ' test_cmp expect actual ' -iconv -f utf-8 -t $test_encoding > commit-msg <commit-msg + else + echo "$message" >commit-msg + fi && -test_expect_success 'setup complex body' ' git config i18n.commitencoding $test_encoding && echo change2 >foo && git commit -a -F commit-msg && head3=$(git rev-parse --verify HEAD) && @@ -448,7 +456,12 @@ test_expect_success 'setup expected messages (for test %b)' ' commit $head2 commit $head1 EOF - iconv -f utf-8 -t $test_encoding expected.utf-8 >expected.ISO8859-1 + if test_have_prereq ICONV + then + iconv -f utf-8 -t $test_encoding expected.utf-8 >expected.ISO8859-1 + else + cp expected.utf-8 expected.ISO8859-1 + fi ' test_format complex-body %b