3 test_description='fetch --all works correctly'
14 git commit -m "Initial" &&
15 git checkout -b side &&
19 git commit -m "Second" &&
24 test_expect_success setup '
25 setup_repository one &&
26 setup_repository two &&
28 cd two && git branch another
30 git clone --mirror two three &&
34 cat > test/expect << EOF
37 origin/HEAD -> origin/master
48 test_expect_success 'git fetch --all' '
50 git remote add one ../one &&
51 git remote add two ../two &&
52 git remote add three ../three &&
54 git branch -r > output &&
55 test_cmp expect output)
58 test_expect_success 'git fetch --all should continue if a remote has errors' '
59 (git clone one test2 &&
61 git remote add bad ../non-existing &&
62 git remote add one ../one &&
63 git remote add two ../two &&
64 git remote add three ../three &&
65 test_must_fail git fetch --all &&
66 git branch -r > output &&
67 test_cmp ../test/expect output)
70 test_expect_success 'git fetch --all does not allow non-option arguments' '
72 test_must_fail git fetch --all origin &&
73 test_must_fail git fetch --all origin master)
77 origin/HEAD -> origin/master
85 test_expect_success 'git fetch --multiple (but only one remote)' '
86 (git clone one test3 &&
88 git remote add three ../three &&
89 git fetch --multiple three &&
90 git branch -r > output &&
91 test_cmp ../expect output)
102 test_expect_success 'git fetch --multiple (two remotes)' '
103 (git clone one test4 &&
105 git remote rm origin &&
106 git remote add one ../one &&
107 git remote add two ../two &&
108 git fetch --multiple one two &&
109 git branch -r > output &&
110 test_cmp ../expect output)
113 test_expect_success 'git fetch --multiple (bad remote names)' '
115 test_must_fail git fetch --multiple four)
119 test_expect_success 'git fetch --all (skipFetchAll)' '
121 for b in $(git branch -r)
123 git branch -r -d $b || break
125 git remote add three ../three &&
126 git config remote.three.skipFetchAll true &&
128 git branch -r > output &&
129 test_cmp ../expect output)
143 test_expect_success 'git fetch --multiple (ignoring skipFetchAll)' '
145 for b in $(git branch -r)
147 git branch -r -d $b || break
149 git fetch --multiple one two three &&
150 git branch -r > output &&
151 test_cmp ../expect output)
154 test_expect_success 'git fetch --all --no-tags' '
156 git clone one test5 &&
157 git clone test5 test6 &&
158 (cd test5 && git tag test-tag) &&
161 git fetch --all --no-tags &&
164 test_cmp expect test6/output
167 test_expect_success 'git fetch --all --tags' '
168 echo test-tag >expect &&
169 git clone one test7 &&
170 git clone test7 test8 &&
173 test_commit test-tag &&
174 git reset --hard HEAD^
178 git fetch --all --tags &&
181 test_cmp expect test8/output