diff options
author | Junio C Hamano <gitster@pobox.com> | 2013-04-22 11:26:58 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-04-22 11:26:58 -0700 |
commit | ac85caa7e91e3ebcbce740275524fe6c1e789dce (patch) | |
tree | 2585ce1814d818185246bd5b339bf6974dfa7700 | |
parent | 34ab7fc461e592c425488f02b315b515cd485fe5 (diff) | |
parent | 002d4ce8aa40644698721d59691d38f1df702f4b (diff) | |
download | git-ac85caa7e91e3ebcbce740275524fe6c1e789dce.tar.gz git-ac85caa7e91e3ebcbce740275524fe6c1e789dce.tar.xz |
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
-rw-r--r-- | t/test-lib.sh | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/t/test-lib.sh b/t/test-lib.sh index 8d76cf23d..657b0bd86 100644 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -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%%-*} |