diff options
author | Junio C Hamano <gitster@pobox.com> | 2013-04-18 11:49:45 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-04-18 11:49:45 -0700 |
commit | ded56521bda84a1b73b198f6cf3a2ac5829446d0 (patch) | |
tree | cc513bf702425d6b34aa0adfc20e6b67ca48de6d /t | |
parent | Merge branch 'th/t9903-symlinked-workdir' (diff) | |
parent | t/test-lib.sh: drop "$test" variable (diff) | |
download | tgif-ded56521bda84a1b73b198f6cf3a2ac5829446d0.tar.xz |
Merge branch 'jk/test-trash'
Fix longstanding issues with the test harness when used with --root=<there>
option.
* 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 debd8b4751..ca6bdef63d 100644 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -600,14 +600,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 @@ -618,13 +618,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%%-*} |