Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-03-19 07:58:01 +0300
committerJunio C Hamano <gitster@pobox.com>2008-03-19 08:17:22 +0300
commit8d14ac945403d6d4b1de9f9fd680247e831c0bfc (patch)
tree75db696c9b6cc0ba2e7f2b5cb3f84a517470c3f1
parent29dc13319883f97618de6f03e8ffc5dc810d8786 (diff)
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>
-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 268b26c959..870b255f13 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"