Skip to content

Commit 002d4ce

Browse files
peffgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 38b074d commit 002d4ce

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

t/test-lib.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -592,11 +592,11 @@ then
592592
fi
593593

594594
# 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" ;;
600600
esac
601601
test ! -z "$debug" || remove_trash=$TRASH_DIRECTORY
602602
rm -fr "$TRASH_DIRECTORY" || {

0 commit comments

Comments
 (0)