3 test_description
='detect unwritable repository and fail correctly'
9 say
"chmod a-w .git/objects does not make directory unwritable - skipping tests"
14 test_expect_success setup
'
19 git commit -m initial &&
25 test_expect_success
'write-tree should notice unwritable repository' '
28 chmod a-w .git/objects .git/objects/?? &&
29 test_must_fail git write-tree
32 chmod 775 .git/objects .git/objects/??
37 test_expect_success
'commit should notice unwritable repository' '
40 chmod a-w .git/objects .git/objects/?? &&
41 test_must_fail git commit -m second
44 chmod 775 .git/objects .git/objects/??
49 test_expect_success
'update-index should notice unwritable repository' '
53 chmod a-w .git/objects .git/objects/?? &&
54 test_must_fail git update-index file
57 chmod 775 .git/objects .git/objects/??
62 test_expect_success
'add should notice unwritable repository' '
66 chmod a-w .git/objects .git/objects/?? &&
67 test_must_fail git add file
70 chmod 775 .git/objects .git/objects/??