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
This commit is contained in:
Junio C Hamano 2013-04-22 11:26:58 -07:00
Родитель 34ab7fc461 002d4ce8aa
Коммит ac85caa7e9
1 изменённых файлов: 9 добавлений и 9 удалений

Просмотреть файл

@ -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%%-*}