completion: Allow dash as the first character for __git_ps1
[git/jnareb-git.git] / t / t5504-fetch-receive-strict.sh
blob8341fc4d154f6d50bf9055b206810dea4e1b807b
1 #!/bin/sh
3 test_description='fetch/receive strict mode'
4 . ./test-lib.sh
6 test_expect_success setup '
7 echo hello >greetings &&
8 git add 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' '
19 rm -rf dst &&
20 git init dst &&
22 cd dst &&
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' '
30 rm -rf dst &&
31 git init dst &&
33 cd dst &&
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' '
41 rm -rf dst &&
42 git init dst &&
44 cd dst &&
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' '
52 rm -rf dst &&
53 git init dst &&
55 cd dst &&
56 git config transfer.fsckobjects true &&
57 test_must_fail git fetch ../.git master
61 test_expect_success 'push without strict' '
62 rm -rf dst &&
63 git init dst &&
65 cd dst &&
66 git config fetch.fsckobjects false &&
67 git config transfer.fsckobjects false
68 ) &&
69 git push dst master:refs/heads/test
72 test_expect_success 'push with !receive.fsckobjects' '
73 rm -rf dst &&
74 git init dst &&
76 cd dst &&
77 git config receive.fsckobjects false &&
78 git config transfer.fsckobjects true
79 ) &&
80 git push dst master:refs/heads/test
83 test_expect_success 'push with receive.fsckobjects' '
84 rm -rf dst &&
85 git init dst &&
87 cd dst &&
88 git config receive.fsckobjects true &&
89 git config transfer.fsckobjects false
90 ) &&
91 test_must_fail git push dst master:refs/heads/test
94 test_expect_success 'push with transfer.fsckobjects' '
95 rm -rf dst &&
96 git init dst &&
98 cd dst &&
99 git config transfer.fsckobjects true
100 ) &&
101 test_must_fail git push dst master:refs/heads/test
104 test_done