Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
Test: catch if trash cannot be removed
author
Junio C Hamano
<gitster@pobox.com>
Wed, 19 Mar 2008 04:58:01 +0000
(21:58 -0700)
committer
Junio C Hamano
<gitster@pobox.com>
Wed, 19 Mar 2008 05:17:22 +0000
(22:17 -0700)
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>
t/test-lib.sh
patch
|
blob
|
history
raw
|
patch
| inline |
side by side
(parent:
29dc133
)
diff --git
a/t/test-lib.sh
b/t/test-lib.sh
index 268b26c959692f8f575fb088143a92c4785b1214..870b255f13e1b2d971b7e036d130d35387e3c2c7 100644
(file)
--- 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"