Code

Merge branch 'jk/maint-do-not-feed-stdin-to-tests'
authorJunio C Hamano <gitster@pobox.com>
Thu, 22 Dec 2011 19:27:25 +0000 (11:27 -0800)
committerJunio C Hamano <gitster@pobox.com>
Thu, 22 Dec 2011 19:27:25 +0000 (11:27 -0800)
* jk/maint-do-not-feed-stdin-to-tests:
  test-lib: redirect stdin of tests

t/test-lib.sh

index 0e932dd9758f71cbc95c6ab20f7c11e9056d7826..a65dfc7ea93b3ec95e6ab7cd5b758029fe599d22 100644 (file)
@@ -192,6 +192,7 @@ then
 fi
 
 exec 5>&1
+exec 6<&0
 if test "$verbose" = "t"
 then
        exec 4>&2 3>&1
@@ -475,7 +476,7 @@ test_debug () {
 test_eval_ () {
        # This is a separate function because some tests use
        # "return" to end a test_expect_success block early.
-       eval >&3 2>&4 "$*"
+       eval </dev/null >&3 2>&4 "$*"
 }
 
 test_run_ () {