| test_description='detect unwritable repository and fail correctly' |
| 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 |
| chmod 775 .git/objects .git/objects/?? |
| test_expect_success POSIXPERM 'commit should notice unwritable repository' ' |
| chmod a-w .git/objects .git/objects/?? && |
| test_must_fail git commit -m second |
| chmod 775 .git/objects .git/objects/?? |
| test_expect_success POSIXPERM 'update-index should notice unwritable repository' ' |
| chmod a-w .git/objects .git/objects/?? && |
| test_must_fail git update-index file |
| chmod 775 .git/objects .git/objects/?? |
| test_expect_success POSIXPERM 'add should notice unwritable repository' ' |
| chmod a-w .git/objects .git/objects/?? && |
| test_must_fail git add file |
| chmod 775 .git/objects .git/objects/?? |