diff --git a/t/test-lib.sh b/t/test-lib.sh index 20bd2ff348..f3736ccd0a 100644 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -17,6 +17,7 @@ # for git on windows so stdin will not be misdetected as attached to a # terminal +test -z "$TEST_NO_REDIRECT" || exec < /dev/null # Keep the original TERM for say_color @@ -524,7 +525,12 @@ maybe_setup_valgrind () { test_eval_ () { # This is a separate function because some tests use # "return" to end a test_expect_success block early. - eval &3 2>&4 "$*" + if test -z "$TEST_NO_REDIRECT" + then + eval &3 2>&4 "$*" + else + eval "$*" + fi } test_run_ () {