diff --git a/t/t5000-tar-tree.sh b/t/t5000-tar-tree.sh index 7b8babd89b..edf9edb03a 100755 --- a/t/t5000-tar-tree.sh +++ b/t/t5000-tar-tree.sh @@ -240,9 +240,11 @@ test_expect_success 'archive --list shows only enabled remote filters' ' test_expect_success 'invoke tar filter by format' ' git archive --format=tar.foo HEAD >config.tar.foo && tr ab ba config.tar && + d2u_force config.tar && test_cmp_bin b.tar config.tar && git archive --format=bar HEAD >config.bar && tr ab ba config.tar && + d2u_force config.tar && test_cmp_bin b.tar config.tar ' @@ -267,6 +269,7 @@ test_expect_success 'only enabled filters are available remotely' ' test_must_fail git archive --remote=. --format=tar.foo HEAD \ >remote.tar.foo && git archive --remote=. --format=bar >remote.bar HEAD && + d2u_force config.bar && test_cmp_bin remote.bar config.bar ' diff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh index dafd6ad21a..729b33ab1e 100644 --- a/t/test-lib-functions.sh +++ b/t/test-lib-functions.sh @@ -866,3 +866,11 @@ mingw_read_file_strip_cr_ () { eval "$1=\$$1\$line" done } + +# Perform dos2unix line ending conversion for binary files +d2u_force() { + if test_have_prereq MINGW + then + dos2unix --force "$1" + fi +}