]>
Commit | Line | Data |
---|---|---|
edae5f0c JH |
1 | #!/bin/sh |
2 | ||
3 | test_description='detect unwritable repository and fail correctly' | |
4 | ||
5 | . ./test-lib.sh | |
6 | ||
7 | test_expect_success setup ' | |
8 | ||
9 | >file && | |
10 | git add file && | |
329636b4 | 11 | test_tick && |
edae5f0c JH |
12 | git commit -m initial && |
13 | echo >file && | |
14 | git add file | |
15 | ||
16 | ' | |
17 | ||
c91cfd19 | 18 | test_expect_success POSIXPERM,SANITY 'write-tree should notice unwritable repository' ' |
dbda9676 JN |
19 | test_when_finished "chmod 775 .git/objects .git/objects/??" && |
20 | chmod a-w .git/objects .git/objects/?? && | |
21 | test_must_fail git write-tree | |
edae5f0c JH |
22 | ' |
23 | ||
c91cfd19 | 24 | test_expect_success POSIXPERM,SANITY 'commit should notice unwritable repository' ' |
dbda9676 JN |
25 | test_when_finished "chmod 775 .git/objects .git/objects/??" && |
26 | chmod a-w .git/objects .git/objects/?? && | |
27 | test_must_fail git commit -m second | |
edae5f0c JH |
28 | ' |
29 | ||
c91cfd19 | 30 | test_expect_success POSIXPERM,SANITY 'update-index should notice unwritable repository' ' |
dbda9676 JN |
31 | test_when_finished "chmod 775 .git/objects .git/objects/??" && |
32 | echo 6O >file && | |
33 | chmod a-w .git/objects .git/objects/?? && | |
34 | test_must_fail git update-index file | |
edae5f0c JH |
35 | ' |
36 | ||
c91cfd19 | 37 | test_expect_success POSIXPERM,SANITY 'add should notice unwritable repository' ' |
dbda9676 JN |
38 | test_when_finished "chmod 775 .git/objects .git/objects/??" && |
39 | echo b >file && | |
40 | chmod a-w .git/objects .git/objects/?? && | |
41 | test_must_fail git add file | |
edae5f0c JH |
42 | ' |
43 | ||
44 | test_done |