aboutsummaryrefslogtreecommitdiff
path: root/t/test-lib.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-03-18 21:58:01 -0700
committerJunio C Hamano <gitster@pobox.com>2008-03-18 22:17:22 -0700
commit8d14ac945403d6d4b1de9f9fd680247e831c0bfc (patch)
tree75db696c9b6cc0ba2e7f2b5cb3f84a517470c3f1 /t/test-lib.sh
parent29dc13319883f97618de6f03e8ffc5dc810d8786 (diff)
downloadgit-8d14ac945403d6d4b1de9f9fd680247e831c0bfc.tar.gz
git-8d14ac945403d6d4b1de9f9fd680247e831c0bfc.tar.xz
Test: catch if trash cannot be removed
When your test creates an unwritable directory that test framework cannot clean out by "rm -fr trash", later tests cannot start in a fresh state they expect to. Detect this and error out early. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/test-lib.sh')
-rw-r--r--t/test-lib.sh7
1 files changed, 6 insertions, 1 deletions
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 268b26c95..870b255f1 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -396,7 +396,12 @@ fi
# Test repository
test=trash
-rm -fr "$test"
+rm -fr "$test" || {
+ trap - exit
+ echo >&5 "FATAL: Cannot prepare test area"
+ exit 1
+}
+
test_create_repo $test
cd "$test"