X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=t%2Ft0004-unwritable.sh;h=e3137d638ee5bb07b9278c1a9b90a207ad024a08;hb=78c5be231bbd58f4deb6ecfabfaff1b2279a4c25;hp=2342ac5788a9976b591cb78593279f092d1dc2f6;hpb=da288e25d9e10b746cf3b311cb4503d1810cde37;p=git.git diff --git a/t/t0004-unwritable.sh b/t/t0004-unwritable.sh index 2342ac578..e3137d638 100755 --- a/t/t0004-unwritable.sh +++ b/t/t0004-unwritable.sh @@ -15,54 +15,30 @@ test_expect_success setup ' ' -test_expect_success POSIXPERM 'write-tree should notice unwritable repository' ' - - ( - chmod a-w .git/objects .git/objects/?? && - test_must_fail git write-tree - ) - status=$? - chmod 775 .git/objects .git/objects/?? - (exit $status) - +test_expect_success POSIXPERM,SANITY 'write-tree should notice unwritable repository' ' + test_when_finished "chmod 775 .git/objects .git/objects/??" && + chmod a-w .git/objects .git/objects/?? && + test_must_fail git write-tree ' -test_expect_success POSIXPERM 'commit should notice unwritable repository' ' - - ( - chmod a-w .git/objects .git/objects/?? && - test_must_fail git commit -m second - ) - status=$? - chmod 775 .git/objects .git/objects/?? - (exit $status) - +test_expect_success POSIXPERM,SANITY 'commit should notice unwritable repository' ' + test_when_finished "chmod 775 .git/objects .git/objects/??" && + chmod a-w .git/objects .git/objects/?? && + test_must_fail git commit -m second ' -test_expect_success POSIXPERM 'update-index should notice unwritable repository' ' - - ( - echo 6O >file && - chmod a-w .git/objects .git/objects/?? && - test_must_fail git update-index file - ) - status=$? - chmod 775 .git/objects .git/objects/?? - (exit $status) - +test_expect_success POSIXPERM,SANITY 'update-index should notice unwritable repository' ' + test_when_finished "chmod 775 .git/objects .git/objects/??" && + echo 6O >file && + chmod a-w .git/objects .git/objects/?? && + test_must_fail git update-index file ' -test_expect_success POSIXPERM 'add should notice unwritable repository' ' - - ( - echo b >file && - chmod a-w .git/objects .git/objects/?? && - test_must_fail git add file - ) - status=$? - chmod 775 .git/objects .git/objects/?? - (exit $status) - +test_expect_success POSIXPERM,SANITY 'add should notice unwritable repository' ' + test_when_finished "chmod 775 .git/objects .git/objects/??" && + echo b >file && + chmod a-w .git/objects .git/objects/?? && + test_must_fail git add file ' test_done