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>
Jeff King committed
Apr 14, 2013 at 15:38 UTC
002d4ce8aa40644698721d59691d38f1df702f4b
1 file changed
+5
-5
t/test-lib.sh
+5
-5
@@ -592,11 +592,11 @@ then
592
fi
593
594
# Test repository
595
-test="trash directory.$(basename "$0" .sh)"
596
-test -n "$root" && test="$root/$test"
597
-case "$test" in
598
-/*) TRASH_DIRECTORY="$test" ;;
599
- *) TRASH_DIRECTORY="$TEST_OUTPUT_DIRECTORY/$test" ;;
595
+TRASH_DIRECTORY="trash directory.$(basename "$0" .sh)"
596
+test -n "$root" && TRASH_DIRECTORY="$root/$TRASH_DIRECTORY"
597
+case "$TRASH_DIRECTORY" in
598
+/*) ;; # absolute path is good
599
+ *) TRASH_DIRECTORY="$TEST_OUTPUT_DIRECTORY/$TRASH_DIRECTORY" ;;
600
esac
601
test ! -z "$debug" || remove_trash=$TRASH_DIRECTORY
602
rm -fr "$TRASH_DIRECTORY" || {