diff options
author | Jeff King <peff@peff.net> | 2013-04-14 21:38:21 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-04-15 08:30:57 +0200 |
commit | 002d4ce8aa40644698721d59691d38f1df702f4b (patch) | |
tree | 85976b4fab6eaa2c07461dee355c040a979bfee2 /t/test-lib.sh | |
parent | t/test-lib.sh: fix TRASH_DIRECTORY handling (diff) | |
download | git-002d4ce8aa40644698721d59691d38f1df702f4b.tar.xz git-002d4ce8aa40644698721d59691d38f1df702f4b.zip |
t/test-lib.sh: drop "$test" variable
The $test variable is used as an interim buffer for
constructing $TRASH_DIRECTORY, and is almost compatible with
it (the exception being that $test has not been converted to
an absolute path). Let's get rid of it entirely so that
later code does not accidentally use it, thinking the two
are interchangeable.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to '')
-rw-r--r-- | t/test-lib.sh | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/t/test-lib.sh b/t/test-lib.sh index c5121f4983..657b0bd862 100644 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -592,11 +592,11 @@ 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 "$TRASH_DIRECTORY" || { |