summaryrefslogtreecommitdiff
path: root/t/test-lib.sh
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2009-08-09 04:38:11 -0400
committerJunio C Hamano <gitster@pobox.com>2009-08-09 10:49:34 -0700
commit91c8b825ce2a301e9861be60c3d7853fefa93c04 (patch)
tree4327e255850c62f711c4e0dd62b2818f8090c3a1 /t/test-lib.sh
parenteaf0551d56b4fd3a97c8d0f5ded1ea6e891f9005 (diff)
downloadgit-91c8b825ce2a301e9861be60c3d7853fefa93c04.tar.gz
tests: provide $TRASH_DIRECTORY variable
Most scripts don't care about the absolute path to the trash directory. The one exception was t4014 script, which pieced together $TEST_DIRECTORY and $test itself to get an absolute directory. Instead, let's provide a $TRASH_DIRECTORY which specifies the same thing. This keeps the $test variable internal to test-lib.sh and paves the way for trash directories in other locations. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/test-lib.sh')
-rw-r--r--t/test-lib.sh3
1 files changed, 2 insertions, 1 deletions
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 5fdc5d94a2..e6a7bb1b45 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -645,7 +645,8 @@ fi
# Test repository
test="trash directory.$(basename "$0" .sh)"
-test ! -z "$debug" || remove_trash="$TEST_DIRECTORY/$test"
+TRASH_DIRECTORY="$TEST_DIRECTORY/$test"
+test ! -z "$debug" || remove_trash=$TRASH_DIRECTORY
rm -fr "$test" || {
GIT_EXIT_OK=t
echo >&5 "FATAL: Cannot prepare test area"