3 test_description='detect unwritable repository and fail correctly'
7 test_expect_success setup '
12 git commit -m initial &&
18 test_expect_success POSIXPERM,SANITY 'write-tree should notice unwritable repository' '
21 chmod a-w .git/objects .git/objects/?? &&
22 test_must_fail git write-tree
25 chmod 775 .git/objects .git/objects/??
30 test_expect_success POSIXPERM,SANITY 'commit should notice unwritable repository' '
33 chmod a-w .git/objects .git/objects/?? &&
34 test_must_fail git commit -m second
37 chmod 775 .git/objects .git/objects/??
42 test_expect_success POSIXPERM,SANITY 'update-index should notice unwritable repository' '
46 chmod a-w .git/objects .git/objects/?? &&
47 test_must_fail git update-index file
50 chmod 775 .git/objects .git/objects/??
55 test_expect_success POSIXPERM,SANITY 'add should notice unwritable repository' '
59 chmod a-w .git/objects .git/objects/?? &&
60 test_must_fail git add file
63 chmod 775 .git/objects .git/objects/??