Skip to content

Commit

Permalink
Merge branch 'jk/test-trash' into maint
Browse files Browse the repository at this point in the history
* jk/test-trash:
  t/test-lib.sh: drop "$test" variable
  t/test-lib.sh: fix TRASH_DIRECTORY handling
  • Loading branch information
Junio C Hamano committed Apr 22, 2013
2 parents 34ab7fc + 002d4ce commit ac85caa
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions t/test-lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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%%-*}
Expand Down

0 comments on commit ac85caa

Please sign in to comment.