summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: eaf0551)
raw | patch | inline | side by side (parent: eaf0551)
author | Jeff King <peff@peff.net> | |
Sun, 9 Aug 2009 08:38:11 +0000 (04:38 -0400) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sun, 9 Aug 2009 17:49:34 +0000 (10:49 -0700) |
Most scripts don't care about the absolute path to the trash
directory. The one exception was t4014 script, which pieced
together $TEST_DIRECTORY and $test itself to get an absolute
directory.
Instead, let's provide a $TRASH_DIRECTORY which specifies
the same thing. This keeps the $test variable internal to
test-lib.sh and paves the way for trash directories in other
locations.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
directory. The one exception was t4014 script, which pieced
together $TEST_DIRECTORY and $test itself to get an absolute
directory.
Instead, let's provide a $TRASH_DIRECTORY which specifies
the same thing. This keeps the $test variable internal to
test-lib.sh and paves the way for trash directories in other
locations.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t4014-format-patch.sh | patch | blob | history | |
t/test-lib.sh | patch | blob | history |
index 922a8941ed4720e2ad6dcd500a3759187aace969..531f5b795c197d942223db3cdc2d2030208e9beb 100755 (executable)
--- a/t/t4014-format-patch.sh
+++ b/t/t4014-format-patch.sh
'
test_expect_success 'format-patch from a subdirectory (3)' '
- here="$TEST_DIRECTORY/$test" &&
rm -f 0* &&
filename=$(
rm -rf sub &&
mkdir -p sub/dir &&
cd sub/dir &&
- git format-patch -1 -o "$here"
+ git format-patch -1 -o "$TRASH_DIRECTORY"
) &&
basename=$(expr "$filename" : ".*/\(.*\)") &&
test -f "$basename"
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 5fdc5d94a20cfcf231bf23590784c5146a3e44bc..e6a7bb1b45e75b7f28a193364a705e51c7f9a154 100644 (file)
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
# Test repository
test="trash directory.$(basename "$0" .sh)"
-test ! -z "$debug" || remove_trash="$TEST_DIRECTORY/$test"
+TRASH_DIRECTORY="$TEST_DIRECTORY/$test"
+test ! -z "$debug" || remove_trash=$TRASH_DIRECTORY
rm -fr "$test" || {
GIT_EXIT_OK=t
echo >&5 "FATAL: Cannot prepare test area"