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>
This commit is contained in:
Junio C Hamano 2008-03-18 21:58:01 -07:00
parent 29dc133198
commit 8d14ac9454

View File

@ -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"