diff options
author | Junio C Hamano <gitster@pobox.com> | 2013-04-22 20:26:58 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-04-22 20:26:58 +0200 |
commit | ac85caa7e91e3ebcbce740275524fe6c1e789dce (patch) | |
tree | 2585ce1814d818185246bd5b339bf6974dfa7700 /t | |
parent | Merge branch 'jk/daemon-user-doc' into maint (diff) | |
parent | t/test-lib.sh: drop "$test" variable (diff) | |
download | git-ac85caa7e91e3ebcbce740275524fe6c1e789dce.tar.xz git-ac85caa7e91e3ebcbce740275524fe6c1e789dce.zip |
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
Diffstat (limited to 't')
-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 8d76cf23d4..657b0bd862 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%%-*} |