]> Pileus Git - ~andy/git/commitdiff
test-lib: do not remove trash_directory if called with --debug
authorJohannes Schindelin <Johannes.Schindelin@gmx.de>
Thu, 21 Aug 2008 07:49:12 +0000 (09:49 +0200)
committerJunio C Hamano <gitster@pobox.com>
Fri, 22 Aug 2008 06:38:25 +0000 (23:38 -0700)
Sometimes you want to keep the trash directory, even if all tests
passed.  For example, when extending tests, it comes it quite handy.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/test-lib.sh

index 6212c46cc1d73695790e7888c0640fe629210abe..e2b106cb6a2337f873a7225670392b376f74c6e7 100644 (file)
@@ -491,7 +491,7 @@ fi
 
 # Test repository
 test="trash directory.$(basename "$0" .sh)"
-remove_trash="$TEST_DIRECTORY/$test"
+test ! -z "$debug" || remove_trash="$TEST_DIRECTORY/$test"
 rm -fr "$test" || {
        trap - exit
        echo >&5 "FATAL: Cannot prepare test area"