3 test_description
='fetch/receive strict mode'
6 test_expect_success setup
'
7 echo hello >greetings &&
9 git commit -m greetings &&
11 S=$(git rev-parse :greetings | sed -e "s|^..|&/|") &&
12 X=$(echo bye | git hash-object -w --stdin | sed -e "s|^..|&/|") &&
13 mv -f .git/objects/$X .git/objects/$S &&
15 test_must_fail git fsck
18 test_expect_success
'fetch without strict' '
23 git config fetch.fsckobjects false &&
24 git config transfer.fsckobjects false &&
25 test_must_fail git fetch ../.git master
29 test_expect_success
'fetch with !fetch.fsckobjects' '
34 git config fetch.fsckobjects false &&
35 git config transfer.fsckobjects true &&
36 test_must_fail git fetch ../.git master
40 test_expect_success
'fetch with fetch.fsckobjects' '
45 git config fetch.fsckobjects true &&
46 git config transfer.fsckobjects false &&
47 test_must_fail git fetch ../.git master
51 test_expect_success
'fetch with transfer.fsckobjects' '
56 git config transfer.fsckobjects true &&
57 test_must_fail git fetch ../.git master
61 test_expect_success
'push without strict' '
66 git config fetch.fsckobjects false &&
67 git config transfer.fsckobjects false
69 git push dst master:refs/heads/test
72 test_expect_success
'push with !receive.fsckobjects' '
77 git config receive.fsckobjects false &&
78 git config transfer.fsckobjects true
80 git push dst master:refs/heads/test
83 test_expect_success
'push with receive.fsckobjects' '
88 git config receive.fsckobjects true &&
89 git config transfer.fsckobjects false
91 test_must_fail git push dst master:refs/heads/test
94 test_expect_success
'push with transfer.fsckobjects' '
99 git config transfer.fsckobjects true
101 test_must_fail git push dst master:refs/heads/test