summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2013-04-18 11:49:45 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2013-04-18 11:49:45 -0700
commitded56521bda84a1b73b198f6cf3a2ac5829446d0 (patch)
treecc513bf702425d6b34aa0adfc20e6b67ca48de6d /t
parentMerge branch 'th/t9903-symlinked-workdir' (diff)
parentt/test-lib.sh: drop "$test" variable (diff)
downloadtgif-ded56521bda84a1b73b198f6cf3a2ac5829446d0.tar.xz
Merge branch 'jk/test-trash'
Fix longstanding issues with the test harness when used with --root=<there> option. * jk/test-trash: t/test-lib.sh: drop "$test" variable t/test-lib.sh: fix TRASH_DIRECTORY handling
Diffstat (limited to 't')
-rw-r--r--t/test-lib.sh18
1 files changed, 9 insertions, 9 deletions
diff --git a/t/test-lib.sh b/t/test-lib.sh
index debd8b4751..ca6bdef63d 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -600,14 +600,14 @@ then
fi
# Test repository
-test="trash directory.$(basename "$0" .sh)"
-test -n "$root" && test="$root/$test"
-case "$test" in
-/*) TRASH_DIRECTORY="$test" ;;
- *) TRASH_DIRECTORY="$TEST_OUTPUT_DIRECTORY/$test" ;;
+TRASH_DIRECTORY="trash directory.$(basename "$0" .sh)"
+test -n "$root" && TRASH_DIRECTORY="$root/$TRASH_DIRECTORY"
+case "$TRASH_DIRECTORY" in
+/*) ;; # absolute path is good
+ *) TRASH_DIRECTORY="$TEST_OUTPUT_DIRECTORY/$TRASH_DIRECTORY" ;;
esac
test ! -z "$debug" || remove_trash=$TRASH_DIRECTORY
-rm -fr "$test" || {
+rm -fr "$TRASH_DIRECTORY" || {
GIT_EXIT_OK=t
echo >&5 "FATAL: Cannot prepare test area"
exit 1
@@ -618,13 +618,13 @@ export HOME
if test -z "$TEST_NO_CREATE_REPO"
then
- test_create_repo "$test"
+ test_create_repo "$TRASH_DIRECTORY"
else
- mkdir -p "$test"
+ mkdir -p "$TRASH_DIRECTORY"
fi
# Use -P to resolve symlinks in our working directory so that the cwd
# in subprocesses like git equals our $PWD (for pathname comparisons).
-cd -P "$test" || exit 1
+cd -P "$TRASH_DIRECTORY" || exit 1
this_test=${0##*/}
this_test=${this_test%%-*}