Code

diff --stat: use a maximum of 5/8 for the filename part
[git.git] / t / test-lib.sh
index 0e932dd9758f71cbc95c6ab20f7c11e9056d7826..a089a188641f47a24e9018d852a3089aaf47d345 100644 (file)
@@ -192,6 +192,7 @@ then
 fi
 
 exec 5>&1
+exec 6<&0
 if test "$verbose" = "t"
 then
        exec 4>&2 3>&1
@@ -380,11 +381,20 @@ test_config () {
        git config "$@"
 }
 
+
 test_config_global () {
        test_when_finished "test_unconfig --global '$1'" &&
        git config --global "$@"
 }
 
+write_script () {
+       {
+               echo "#!${2-"$SHELL_PATH"}" &&
+               cat
+       } >"$1" &&
+       chmod +x "$1"
+}
+
 # Use test_set_prereq to tell that a particular prerequisite is available.
 # The prerequisite can later be checked for in two ways:
 #
@@ -475,7 +485,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_ () {