summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-04-22 18:26:58 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-04-22 18:26:58 (GMT)
commitac85caa7e91e3ebcbce740275524fe6c1e789dce (patch)
tree2585ce1814d818185246bd5b339bf6974dfa7700 /t
parent34ab7fc461e592c425488f02b315b515cd485fe5 (diff)
parent002d4ce8aa40644698721d59691d38f1df702f4b (diff)
downloadgit-ac85caa7e91e3ebcbce740275524fe6c1e789dce.zip
git-ac85caa7e91e3ebcbce740275524fe6c1e789dce.tar.gz
git-ac85caa7e91e3ebcbce740275524fe6c1e789dce.tar.bz2
Merge branch 'jk/test-trash' into maint
* 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 8d76cf2..657b0bd 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -592,14 +592,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
@@ -610,13 +610,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%%-*}