Merge branch 'mv/clonev'
[gitweb.git] / t / test-lib.sh
index 7f60b614eafb3da9f481e1c7df38f9d8fbfeb076..8936173ee204c589fb299837586b4866722b2388 100644 (file)
@@ -112,8 +112,9 @@ if test -n "$color"; then
                        *) test -n "$quiet" && return;;
                esac
                shift
-               echo "* $*"
+               printf "* %s" "$*"
                tput sgr0
+               echo
                )
        }
 else
@@ -406,7 +407,7 @@ test_create_repo () {
        error "bug in the test script: not 1 parameter to test-create-repo"
        owd=`pwd`
        repo="$1"
-       mkdir "$repo"
+       mkdir -p "$repo"
        cd "$repo" || error "Cannot setup test environment"
        "$GIT_EXEC_PATH/git" init "--template=$GIT_EXEC_PATH/templates/blt/" >&3 2>&4 ||
        error "cannot run git init -- have you built things yet?"
@@ -491,7 +492,7 @@ fi
 
 # Test repository
 test="trash directory.$(basename "$0" .sh)"
-remove_trash="$TEST_DIRECTORY/$test"
+test ! -z "$debug" || remove_trash="$TEST_DIRECTORY/$test"
 rm -fr "$test" || {
        trap - exit
        echo >&5 "FATAL: Cannot prepare test area"