diff --git a/t/test-lib.sh b/t/test-lib.sh
index 5fdc5d94a20cfcf231bf23590784c5146a3e44bc..a5b8d03db0fc88c42e38cdde13a6cd2b14c06581 100644 (file)
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
valgrind=t; verbose=t; shift ;;
--tee)
shift ;; # was handled already
valgrind=t; verbose=t; shift ;;
--tee)
shift ;; # was handled already
+ --root=*)
+ root=$(expr "z$1" : 'z[^=]*=\(.*\)')
+ shift ;;
*)
echo "error: unknown test option '$1'" >&2; exit 1 ;;
esac
*)
echo "error: unknown test option '$1'" >&2; exit 1 ;;
esac
# Test repository
test="trash directory.$(basename "$0" .sh)"
# Test repository
test="trash directory.$(basename "$0" .sh)"
-test ! -z "$debug" || remove_trash="$TEST_DIRECTORY/$test"
+test -n "$root" && test="$root/$test"
+case "$test" in
+/*) TRASH_DIRECTORY="$test" ;;
+ *) TRASH_DIRECTORY="$TEST_DIRECTORY/$test" ;;
+esac
+test ! -z "$debug" || remove_trash=$TRASH_DIRECTORY
rm -fr "$test" || {
GIT_EXIT_OK=t
echo >&5 "FATAL: Cannot prepare test area"
rm -fr "$test" || {
GIT_EXIT_OK=t
echo >&5 "FATAL: Cannot prepare test area"