3 # Copyright (c) 2020 Stefan Sperling <stsp@openbsd.org>
5 # Permission to use, copy, modify, and distribute this software for any
6 # purpose with or without fee is hereby granted, provided that the above
7 # copyright notice and this permission notice appear in all copies.
9 # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
20 local testroot
=`test_init fetch_basic`
21 local testurl
=ssh://127.0.0.1/$testroot
22 local commit_id
=`git_show_head $testroot/repo`
24 got clone
-q $testurl/repo
$testroot/repo-clone
26 if [ $ret -ne 0 ]; then
27 echo "got clone command failed unexpectedly" >&2
28 test_done
"$testroot" "$ret"
32 echo "modified alpha" > $testroot/repo
/alpha
33 git_commit
$testroot/repo
-m "modified alpha"
34 local commit_id2
=`git_show_head $testroot/repo`
36 got ref
-l -r $testroot/repo-clone
> $testroot/stdout
38 if [ $ret -ne 0 ]; then
39 echo "got ref command failed unexpectedly" >&2
40 test_done
"$testroot" "$ret"
44 got fetch
-q -r $testroot/repo-clone
> $testroot/stdout \
47 if [ $ret -ne 0 ]; then
48 echo "got fetch command failed unexpectedly" >&2
49 test_done
"$testroot" "$ret"
53 echo -n > $testroot/stdout.expected
55 cmp -s $testroot/stdout
$testroot/stdout.expected
57 if [ $ret -ne 0 ]; then
58 diff -u $testroot/stdout.expected
$testroot/stdout
59 test_done
"$testroot" "$ret"
63 got log
-l0 -p -r $testroot/repo
> $testroot/log-repo
65 if [ $ret -ne 0 ]; then
66 echo "got log command failed unexpectedly" >&2
67 test_done
"$testroot" "$ret"
70 got log
-l0 -p -r $testroot/repo
> $testroot/log-repo-clone
72 if [ $ret -ne 0 ]; then
73 echo "got log command failed unexpectedly" >&2
74 test_done
"$testroot" "$ret"
77 cmp -s $testroot/log-repo
$testroot/log-repo-clone
79 if [ $ret -ne 0 ]; then
80 echo "log -p output of cloned repository differs" >&2
81 test_done
"$testroot" "$ret"
85 got ref
-l -r $testroot/repo
> $testroot/stdout
87 if [ $ret -ne 0 ]; then
88 echo "got ref command failed unexpectedly" >&2
89 test_done
"$testroot" "$ret"
93 echo "HEAD: refs/heads/master" > $testroot/stdout.expected
94 echo "refs/heads/master: $commit_id2" >> $testroot/stdout.expected
96 cmp -s $testroot/stdout
$testroot/stdout.expected
98 if [ $ret -ne 0 ]; then
99 diff -u $testroot/stdout.expected
$testroot/stdout
100 test_done
"$testroot" "$ret"
104 got ref
-l -r $testroot/repo-clone
> $testroot/stdout
106 if [ $ret -ne 0 ]; then
107 echo "got ref command failed unexpectedly" >&2
108 test_done
"$testroot" "$ret"
112 echo "HEAD: refs/heads/master" > $testroot/stdout.expected
113 echo "refs/heads/master: $commit_id" >> $testroot/stdout.expected
114 echo "refs/remotes/origin/HEAD: refs/remotes/origin/master" \
115 >> $testroot/stdout.expected
116 echo "refs/remotes/origin/master: $commit_id2" \
117 >> $testroot/stdout.expected
119 cmp -s $testroot/stdout
$testroot/stdout.expected
121 if [ $ret -ne 0 ]; then
122 diff -u $testroot/stdout.expected
$testroot/stdout
124 test_done
"$testroot" "$ret"
128 local testroot
=`test_init fetch_list`
129 local testurl
=ssh://127.0.0.1/$testroot
130 local commit_id
=`git_show_head $testroot/repo`
132 got branch
-r $testroot/repo
-c $commit_id foo
133 got ref
-r $testroot/repo
-c $commit_id refs
/hoo
/boo
/zoo
134 got tag
-r $testroot/repo
-c $commit_id -m tag
"1.0" >/dev
/null
136 got clone
-q $testurl/repo
$testroot/repo-clone
138 if [ $ret -ne 0 ]; then
139 echo "got clone command failed unexpectedly" >&2
140 test_done
"$testroot" "$ret"
144 (cd $testroot/repo-clone
&& got fetch
-q -l \
145 > $testroot/stdout
2>$testroot/stderr
)
147 if [ $ret -ne 0 ]; then
148 echo "got fetch command failed unexpectedly" >&2
149 test_done
"$testroot" "$ret"
153 got ref
-l -r $testroot/repo
> $testroot/stdout.expected
155 cmp -s $testroot/stdout
$testroot/stdout.expected
157 if [ $ret -ne 0 ]; then
158 diff -u $testroot/stdout.expected
$testroot/stdout
160 test_done
"$testroot" "$ret"
163 test_fetch_branch
() {
164 local testroot
=`test_init fetch_branch`
165 local testurl
=ssh://127.0.0.1/$testroot
166 local commit_id
=`git_show_head $testroot/repo`
168 got clone
-q $testurl/repo
$testroot/repo-clone
170 if [ $ret -ne 0 ]; then
171 echo "got clone command failed unexpectedly" >&2
172 test_done
"$testroot" "$ret"
176 got branch
-r $testroot/repo
-c $commit_id foo
177 got ref
-r $testroot/repo
-c $commit_id refs
/hoo
/boo
/zoo
178 got tag
-r $testroot/repo
-c $commit_id -m tag
"1.0" >/dev
/null
179 local tag_id
=`got ref -r $testroot/repo -l \
180 | grep "^refs/tags/$tag" | tr -d ' ' | cut -d: -f2`
182 echo "modified alpha on master" > $testroot/repo
/alpha
183 git_commit
$testroot/repo
-m "modified alpha"
184 local commit_id2
=`git_show_head $testroot/repo`
186 (cd $testroot/repo
&& git checkout
-q foo
)
187 echo "modified alpha on foo" > $testroot/repo
/alpha
188 git_commit
$testroot/repo
-m "modified alpha"
189 local commit_id3
=`git_show_head $testroot/repo`
191 got fetch
-q -r $testroot/repo-clone
-b foo
> $testroot/stdout
193 if [ $ret -ne 0 ]; then
194 echo "got fetch command failed unexpectedly" >&2
195 test_done
"$testroot" "$ret"
199 echo -n > $testroot/stdout.expected
201 cmp -s $testroot/stdout
$testroot/stdout.expected
203 if [ $ret -ne 0 ]; then
204 diff -u $testroot/stdout.expected
$testroot/stdout
205 test_done
"$testroot" "$ret"
209 got ref
-l -r $testroot/repo-clone
> $testroot/stdout
211 echo "HEAD: refs/heads/master" > $testroot/stdout.expected
212 echo "refs/heads/foo: $commit_id3" >> $testroot/stdout.expected
213 echo "refs/heads/master: $commit_id" >> $testroot/stdout.expected
214 echo "refs/remotes/origin/HEAD: refs/remotes/origin/foo" \
215 >> $testroot/stdout.expected
216 echo "refs/remotes/origin/foo: $commit_id3" >> $testroot/stdout.expected
217 # refs/remotes/origin/master is umodified because it wasn't fetched
218 echo "refs/remotes/origin/master: $commit_id" \
219 >> $testroot/stdout.expected
220 # refs/hoo/boo/zoo is missing because it is outside of refs/heads
221 echo "refs/tags/1.0: $tag_id" >> $testroot/stdout.expected
223 cmp -s $testroot/stdout
$testroot/stdout.expected
225 if [ $ret -ne 0 ]; then
226 diff -u $testroot/stdout.expected
$testroot/stdout
227 test_done
"$testroot" "$ret"
231 got fetch
-q -r $testroot/repo-clone
-b master
> $testroot/stdout
233 if [ $ret -ne 0 ]; then
234 echo "got fetch command failed unexpectedly" >&2
235 test_done
"$testroot" "$ret"
239 echo -n > $testroot/stdout.expected
241 cmp -s $testroot/stdout
$testroot/stdout.expected
243 if [ $ret -ne 0 ]; then
244 diff -u $testroot/stdout.expected
$testroot/stdout
245 test_done
"$testroot" "$ret"
249 got ref
-l -r $testroot/repo-clone
> $testroot/stdout
251 echo "HEAD: refs/heads/master" > $testroot/stdout.expected
252 echo "refs/heads/foo: $commit_id3" >> $testroot/stdout.expected
253 echo "refs/heads/master: $commit_id" >> $testroot/stdout.expected
254 echo "refs/remotes/origin/HEAD: refs/remotes/origin/foo" \
255 >> $testroot/stdout.expected
256 echo "refs/remotes/origin/foo: $commit_id3" >> $testroot/stdout.expected
257 echo "refs/remotes/origin/master: $commit_id2" \
258 >> $testroot/stdout.expected
259 # refs/hoo/boo/zoo is missing because it is outside of refs/heads
260 echo "refs/tags/1.0: $tag_id" >> $testroot/stdout.expected
262 cmp -s $testroot/stdout
$testroot/stdout.expected
264 if [ $ret -ne 0 ]; then
265 diff -u $testroot/stdout.expected
$testroot/stdout
267 test_done
"$testroot" "$ret"
271 local testroot
=`test_init fetch_all`
272 local testurl
=ssh://127.0.0.1/$testroot
273 local commit_id
=`git_show_head $testroot/repo`
275 got clone
-q $testurl/repo
$testroot/repo-clone
277 if [ $ret -ne 0 ]; then
278 echo "got clone command failed unexpectedly" >&2
279 test_done
"$testroot" "$ret"
283 got branch
-r $testroot/repo
-c $commit_id foo
284 got ref
-r $testroot/repo
-c $commit_id refs
/hoo
/boo
/zoo
285 got tag
-r $testroot/repo
-c $commit_id -m tag
"1.0" >/dev
/null
286 local tag_id
=`got ref -r $testroot/repo -l \
287 | grep "^refs/tags/$tag" | tr -d ' ' | cut -d: -f2`
289 got ref
-l -r $testroot/repo-clone
> $testroot/stdout
291 echo "HEAD: refs/heads/master" > $testroot/stdout.expected
292 echo "refs/heads/master: $commit_id" >> $testroot/stdout.expected
293 echo "refs/remotes/origin/HEAD: refs/remotes/origin/master" \
294 >> $testroot/stdout.expected
295 echo "refs/remotes/origin/master: $commit_id" \
296 >> $testroot/stdout.expected
297 # refs/hoo/boo/zoo is missing because it is outside of refs/heads
299 cmp -s $testroot/stdout
$testroot/stdout.expected
301 if [ $ret -ne 0 ]; then
302 diff -u $testroot/stdout.expected
$testroot/stdout
303 test_done
"$testroot" "$ret"
307 got fetch
-q -a -r $testroot/repo-clone
309 if [ $ret -ne 0 ]; then
310 echo "got fetch command failed unexpectedly" >&2
311 test_done
"$testroot" "$ret"
315 got ref
-l -r $testroot/repo-clone
> $testroot/stdout
317 echo "HEAD: refs/heads/master" > $testroot/stdout.expected
318 echo "refs/heads/foo: $commit_id" >> $testroot/stdout.expected
319 echo "refs/heads/master: $commit_id" >> $testroot/stdout.expected
320 echo "refs/remotes/origin/HEAD: refs/remotes/origin/master" \
321 >> $testroot/stdout.expected
322 echo "refs/remotes/origin/foo: $commit_id" >> $testroot/stdout.expected
323 echo "refs/remotes/origin/master: $commit_id" \
324 >> $testroot/stdout.expected
325 # refs/hoo/boo/zoo is missing because it is outside of refs/heads
326 echo "refs/tags/1.0: $tag_id" >> $testroot/stdout.expected
328 cmp -s $testroot/stdout
$testroot/stdout.expected
330 if [ $ret -ne 0 ]; then
331 diff -u $testroot/stdout.expected
$testroot/stdout
333 test_done
"$testroot" "$ret"
336 test_fetch_empty_packfile
() {
337 local testroot
=`test_init fetch_empty_packfile`
338 local testurl
=ssh://127.0.0.1/$testroot
339 local commit_id
=`git_show_head $testroot/repo`
341 got tag
-r $testroot/repo
-c $commit_id -m tag
"1.0" >/dev
/null
342 local tag_id
=`got ref -r $testroot/repo -l \
343 | grep "^refs/tags/$tag" | tr -d ' ' | cut -d: -f2`
345 got clone
-q $testurl/repo
$testroot/repo-clone
347 if [ $ret -ne 0 ]; then
348 echo "got clone command failed unexpectedly" >&2
349 test_done
"$testroot" "$ret"
353 got branch
-r $testroot/repo
-c $commit_id foo
354 got ref
-r $testroot/repo
-c $commit_id refs
/hoo
/boo
/zoo
356 got ref
-l -r $testroot/repo-clone
> $testroot/stdout
358 echo "HEAD: refs/heads/master" > $testroot/stdout.expected
359 echo "refs/heads/master: $commit_id" >> $testroot/stdout.expected
360 echo "refs/remotes/origin/HEAD: refs/remotes/origin/master" \
361 >> $testroot/stdout.expected
362 echo "refs/remotes/origin/master: $commit_id" \
363 >> $testroot/stdout.expected
364 # refs/hoo/boo/zoo is missing because it is outside of refs/heads
365 echo "refs/tags/1.0: $tag_id" >> $testroot/stdout.expected
367 cmp -s $testroot/stdout
$testroot/stdout.expected
369 if [ $ret -ne 0 ]; then
370 diff -u $testroot/stdout.expected
$testroot/stdout
371 test_done
"$testroot" "$ret"
375 got fetch
-q -a -r $testroot/repo-clone
377 if [ $ret -ne 0 ]; then
378 echo "got fetch command failed unexpectedly" >&2
379 test_done
"$testroot" "$ret"
383 got ref
-l -r $testroot/repo-clone
> $testroot/stdout
385 echo "HEAD: refs/heads/master" > $testroot/stdout.expected
386 echo "refs/heads/foo: $commit_id" >> $testroot/stdout.expected
387 echo "refs/heads/master: $commit_id" >> $testroot/stdout.expected
388 echo "refs/remotes/origin/HEAD: refs/remotes/origin/master" \
389 >> $testroot/stdout.expected
390 echo "refs/remotes/origin/foo: $commit_id" >> $testroot/stdout.expected
391 echo "refs/remotes/origin/master: $commit_id" \
392 >> $testroot/stdout.expected
393 # refs/hoo/boo/zoo is missing because it is outside of refs/heads
394 echo "refs/tags/1.0: $tag_id" >> $testroot/stdout.expected
396 cmp -s $testroot/stdout
$testroot/stdout.expected
398 if [ $ret -ne 0 ]; then
399 diff -u $testroot/stdout.expected
$testroot/stdout
401 test_done
"$testroot" "$ret"
404 test_fetch_delete_branch
() {
405 local testroot
=`test_init fetch_delete_branch`
406 local testurl
=ssh://127.0.0.1/$testroot
407 local commit_id
=`git_show_head $testroot/repo`
410 got branch
-r $testroot/repo
-c $commit_id foo
411 got ref
-r $testroot/repo
-c $commit_id refs
/hoo
/boo
/zoo
412 got tag
-r $testroot/repo
-c $commit_id -m tag
"1.0" >/dev
/null
413 local tag_id
=`got ref -r $testroot/repo -l \
414 | grep "^refs/tags/$tag" | tr -d ' ' | cut -d: -f2`
416 got clone
-a -q $testurl/repo
$testroot/repo-clone
418 if [ $ret -ne 0 ]; then
419 echo "got clone command failed unexpectedly" >&2
420 test_done
"$testroot" "$ret"
424 got ref
-l -r $testroot/repo-clone
> $testroot/stdout
426 echo "HEAD: refs/heads/master" > $testroot/stdout.expected
427 echo "refs/heads/foo: $commit_id" >> $testroot/stdout.expected
428 echo "refs/heads/master: $commit_id" >> $testroot/stdout.expected
429 echo "refs/remotes/origin/HEAD: refs/remotes/origin/master" \
430 >> $testroot/stdout.expected
431 echo "refs/remotes/origin/foo: $commit_id" \
432 >> $testroot/stdout.expected
433 echo "refs/remotes/origin/master: $commit_id" \
434 >> $testroot/stdout.expected
435 # refs/hoo/boo/zoo is missing because it is outside of refs/heads
436 echo "refs/tags/1.0: $tag_id" >> $testroot/stdout.expected
438 cmp -s $testroot/stdout
$testroot/stdout.expected
440 if [ $ret -ne 0 ]; then
441 diff -u $testroot/stdout.expected
$testroot/stdout
442 test_done
"$testroot" "$ret"
446 got branch
-r $testroot/repo
-d foo
>/dev
/null
448 got fetch
-q -r $testroot/repo-clone
450 if [ $ret -ne 0 ]; then
451 echo "got fetch command failed unexpectedly" >&2
452 test_done
"$testroot" "$ret"
456 got ref
-l -r $testroot/repo-clone
> $testroot/stdout
458 echo "HEAD: refs/heads/master" > $testroot/stdout.expected
459 echo "refs/heads/foo: $commit_id" >> $testroot/stdout.expected
460 echo "refs/heads/master: $commit_id" >> $testroot/stdout.expected
461 echo "refs/remotes/origin/HEAD: refs/remotes/origin/master" \
462 >> $testroot/stdout.expected
463 echo "refs/remotes/origin/foo: $commit_id" >> $testroot/stdout.expected
464 echo "refs/remotes/origin/master: $commit_id" \
465 >> $testroot/stdout.expected
466 # refs/hoo/boo/zoo is missing because it is outside of refs/heads
467 echo "refs/tags/1.0: $tag_id" >> $testroot/stdout.expected
469 cmp -s $testroot/stdout
$testroot/stdout.expected
471 if [ $ret -ne 0 ]; then
472 diff -u $testroot/stdout.expected
$testroot/stdout
473 test_done
"$testroot" "$ret"
477 got fetch
-d -q -r $testroot/repo-clone
> $testroot/stdout
479 if [ $ret -ne 0 ]; then
480 echo "got fetch command failed unexpectedly" >&2
481 test_done
"$testroot" "$ret"
485 echo -n > $testroot/stdout.expected
487 cmp -s $testroot/stdout
$testroot/stdout.expected
489 if [ $ret -ne 0 ]; then
490 diff -u $testroot/stdout.expected
$testroot/stdout
491 test_done
"$testroot" "$ret"
495 got ref
-l -r $testroot/repo-clone
> $testroot/stdout
497 echo "HEAD: refs/heads/master" > $testroot/stdout.expected
498 # refs/heads/foo is now deleted
499 echo "refs/heads/master: $commit_id" >> $testroot/stdout.expected
500 echo "refs/remotes/origin/HEAD: refs/remotes/origin/master" \
501 >> $testroot/stdout.expected
502 # refs/remotes/origin/foo is now deleted
503 echo "refs/remotes/origin/master: $commit_id" \
504 >> $testroot/stdout.expected
505 # refs/hoo/boo/zoo is missing because it is outside of refs/heads
506 echo "refs/tags/1.0: $tag_id" >> $testroot/stdout.expected
508 cmp -s $testroot/stdout
$testroot/stdout.expected
510 if [ $ret -ne 0 ]; then
511 diff -u $testroot/stdout.expected
$testroot/stdout
513 test_done
"$testroot" "$ret"
517 test_fetch_delete_branch_mirror
() {
518 local testroot
=`test_init fetch_delete_branch_mirror`
519 local testurl
=ssh://127.0.0.1/$testroot
520 local commit_id
=`git_show_head $testroot/repo`
522 got branch
-r $testroot/repo
-c $commit_id foo
523 got ref
-r $testroot/repo
-c $commit_id refs
/hoo
/boo
/zoo
524 got tag
-r $testroot/repo
-c $commit_id -m tag
"1.0" >/dev
/null
525 local tag_id
=`got ref -r $testroot/repo -l \
526 | grep "^refs/tags/$tag" | tr -d ' ' | cut -d: -f2`
528 got clone
-a -m -q $testurl/repo
$testroot/repo-clone
530 if [ $ret -ne 0 ]; then
531 echo "got clone command failed unexpectedly" >&2
532 test_done
"$testroot" "$ret"
536 got ref
-l -r $testroot/repo-clone
> $testroot/stdout
538 echo "HEAD: refs/heads/master" > $testroot/stdout.expected
539 echo "refs/heads/foo: $commit_id" >> $testroot/stdout.expected
540 echo "refs/heads/master: $commit_id" >> $testroot/stdout.expected
541 # refs/hoo/boo/zoo is missing because it is outside of refs/heads
542 echo "refs/tags/1.0: $tag_id" >> $testroot/stdout.expected
544 cmp -s $testroot/stdout
$testroot/stdout.expected
546 if [ $ret -ne 0 ]; then
547 diff -u $testroot/stdout.expected
$testroot/stdout
548 test_done
"$testroot" "$ret"
552 got branch
-r $testroot/repo
-d foo
>/dev
/null
554 got fetch
-q -r $testroot/repo-clone
556 if [ $ret -ne 0 ]; then
557 echo "got fetch command failed unexpectedly" >&2
558 test_done
"$testroot" "$ret"
562 got ref
-l -r $testroot/repo-clone
> $testroot/stdout
564 echo "HEAD: refs/heads/master" > $testroot/stdout.expected
565 echo "refs/heads/foo: $commit_id" >> $testroot/stdout.expected
566 echo "refs/heads/master: $commit_id" >> $testroot/stdout.expected
567 # refs/hoo/boo/zoo is missing because it is outside of refs/heads
568 echo "refs/tags/1.0: $tag_id" >> $testroot/stdout.expected
570 cmp -s $testroot/stdout
$testroot/stdout.expected
572 if [ $ret -ne 0 ]; then
573 diff -u $testroot/stdout.expected
$testroot/stdout
574 test_done
"$testroot" "$ret"
578 got fetch
-d -q -r $testroot/repo-clone
> $testroot/stdout
580 if [ $ret -ne 0 ]; then
581 echo "got fetch command failed unexpectedly" >&2
582 test_done
"$testroot" "$ret"
586 echo -n > $testroot/stdout.expected
588 cmp -s $testroot/stdout
$testroot/stdout.expected
590 if [ $ret -ne 0 ]; then
591 diff -u $testroot/stdout.expected
$testroot/stdout
592 test_done
"$testroot" "$ret"
596 got ref
-l -r $testroot/repo-clone
> $testroot/stdout
598 echo "HEAD: refs/heads/master" > $testroot/stdout.expected
599 # refs/heads/foo is now deleted
600 echo "refs/heads/master: $commit_id" >> $testroot/stdout.expected
601 # refs/hoo/boo/zoo is missing because it is outside of refs/heads
602 echo "refs/tags/1.0: $tag_id" >> $testroot/stdout.expected
604 cmp -s $testroot/stdout
$testroot/stdout.expected
606 if [ $ret -ne 0 ]; then
607 diff -u $testroot/stdout.expected
$testroot/stdout
609 test_done
"$testroot" "$ret"
613 test_fetch_update_tag
() {
614 local testroot
=`test_init fetch_update_tag`
615 local testurl
=ssh://127.0.0.1/$testroot
616 local commit_id
=`git_show_head $testroot/repo`
619 got branch
-r $testroot/repo
-c $commit_id foo
620 got ref
-r $testroot/repo
-c $commit_id refs
/hoo
/boo
/zoo
621 got tag
-r $testroot/repo
-c $commit_id -m tag
"1.0" >/dev
/null
622 local tag_id
=`got ref -r $testroot/repo -l \
623 | grep "^refs/tags/$tag" | tr -d ' ' | cut -d: -f2`
625 got clone
-a -q $testurl/repo
$testroot/repo-clone
627 if [ $ret -ne 0 ]; then
628 echo "got clone command failed unexpectedly" >&2
629 test_done
"$testroot" "$ret"
633 echo "modified alpha on master" > $testroot/repo
/alpha
634 git_commit
$testroot/repo
-m "modified alpha"
635 local commit_id2
=`git_show_head $testroot/repo`
637 got ref
-r $testroot/repo
-d "refs/tags/1.0" >/dev
/null
638 got tag
-r $testroot/repo
-c $commit_id2 -m tag
"1.0" >/dev
/null
639 local tag_id2
=`got ref -r $testroot/repo -l \
640 | grep "^refs/tags/$tag" | tr -d ' ' | cut -d: -f2`
642 got ref
-l -r $testroot/repo-clone
> $testroot/stdout
644 echo "HEAD: refs/heads/master" > $testroot/stdout.expected
645 echo "refs/heads/foo: $commit_id" >> $testroot/stdout.expected
646 echo "refs/heads/master: $commit_id" >> $testroot/stdout.expected
647 echo "refs/remotes/origin/HEAD: refs/remotes/origin/master" \
648 >> $testroot/stdout.expected
649 echo "refs/remotes/origin/foo: $commit_id" \
650 >> $testroot/stdout.expected
651 echo "refs/remotes/origin/master: $commit_id" \
652 >> $testroot/stdout.expected
653 # refs/hoo/boo/zoo is missing because it is outside of refs/heads
654 echo "refs/tags/1.0: $tag_id" >> $testroot/stdout.expected
656 cmp -s $testroot/stdout
$testroot/stdout.expected
658 if [ $ret -ne 0 ]; then
659 diff -u $testroot/stdout.expected
$testroot/stdout
660 test_done
"$testroot" "$ret"
664 got fetch
-a -q -r $testroot/repo-clone
666 if [ $ret -ne 0 ]; then
667 echo "got fetch command failed unexpectedly" >&2
668 test_done
"$testroot" "$ret"
672 got ref
-l -r $testroot/repo-clone
> $testroot/stdout
674 echo "HEAD: refs/heads/master" > $testroot/stdout.expected
675 echo "refs/heads/foo: $commit_id" >> $testroot/stdout.expected
676 echo "refs/heads/master: $commit_id" >> $testroot/stdout.expected
677 echo "refs/remotes/origin/HEAD: refs/remotes/origin/master" \
678 >> $testroot/stdout.expected
679 echo "refs/remotes/origin/foo: $commit_id" >> $testroot/stdout.expected
680 echo "refs/remotes/origin/master: $commit_id2" \
681 >> $testroot/stdout.expected
682 # refs/hoo/boo/zoo is missing because it is outside of refs/heads
683 echo "refs/tags/1.0: $tag_id" >> $testroot/stdout.expected
685 cmp -s $testroot/stdout
$testroot/stdout.expected
687 if [ $ret -ne 0 ]; then
688 diff -u $testroot/stdout.expected
$testroot/stdout
689 test_done
"$testroot" "$ret"
693 got fetch
-r $testroot/repo-clone
2> $testroot/stderr | \
694 tail -n 1 > $testroot/stdout
696 if [ $ret -ne 0 ]; then
697 echo "got fetch command failed unexpectedly" >&2
698 test_done
"$testroot" "$ret"
702 echo "Rejecting update of existing tag refs/tags/1.0: $tag_id2" \
703 > $testroot/stdout.expected
705 cmp -s $testroot/stdout
$testroot/stdout.expected
707 if [ $ret -ne 0 ]; then
708 diff -u $testroot/stdout.expected
$testroot/stdout
709 test_done
"$testroot" "$ret"
713 got ref
-l -r $testroot/repo-clone
> $testroot/stdout
715 echo "HEAD: refs/heads/master" > $testroot/stdout.expected
716 echo "refs/heads/foo: $commit_id" >> $testroot/stdout.expected
717 echo "refs/heads/master: $commit_id" >> $testroot/stdout.expected
718 echo "refs/remotes/origin/HEAD: refs/remotes/origin/master" \
719 >> $testroot/stdout.expected
720 echo "refs/remotes/origin/foo: $commit_id" >> $testroot/stdout.expected
721 echo "refs/remotes/origin/master: $commit_id2" \
722 >> $testroot/stdout.expected
723 # refs/hoo/boo/zoo is missing because it is outside of refs/heads
724 echo "refs/tags/1.0: $tag_id" >> $testroot/stdout.expected
726 cmp -s $testroot/stdout
$testroot/stdout.expected
728 if [ $ret -ne 0 ]; then
729 diff -u $testroot/stdout.expected
$testroot/stdout
730 test_done
"$testroot" "$ret"
734 got fetch
-q -t -r $testroot/repo-clone
> $testroot/stdout
736 if [ $ret -ne 0 ]; then
737 echo "got fetch command failed unexpectedly" >&2
738 test_done
"$testroot" "$ret"
742 echo -n > $testroot/stdout.expected
744 cmp -s $testroot/stdout
$testroot/stdout.expected
746 if [ $ret -ne 0 ]; then
747 diff -u $testroot/stdout.expected
$testroot/stdout
748 test_done
"$testroot" "$ret"
752 got ref
-l -r $testroot/repo-clone
> $testroot/stdout
754 echo "HEAD: refs/heads/master" > $testroot/stdout.expected
755 echo "refs/heads/foo: $commit_id" >> $testroot/stdout.expected
756 echo "refs/heads/master: $commit_id" >> $testroot/stdout.expected
757 echo "refs/remotes/origin/HEAD: refs/remotes/origin/master" \
758 >> $testroot/stdout.expected
759 echo "refs/remotes/origin/foo: $commit_id" >> $testroot/stdout.expected
760 echo "refs/remotes/origin/master: $commit_id2" \
761 >> $testroot/stdout.expected
762 # refs/hoo/boo/zoo is missing because it is outside of refs/heads
763 echo "refs/tags/1.0: $tag_id2" >> $testroot/stdout.expected
765 cmp -s $testroot/stdout
$testroot/stdout.expected
767 if [ $ret -ne 0 ]; then
768 diff -u $testroot/stdout.expected
$testroot/stdout
770 test_done
"$testroot" "$ret"
773 test_fetch_reference
() {
774 local testroot
=`test_init fetch_reference`
775 local testurl
=ssh://127.0.0.1/$testroot
776 local commit_id
=`git_show_head $testroot/repo`
778 got clone
-q $testurl/repo
$testroot/repo-clone
780 if [ $ret -ne 0 ]; then
781 echo "got clone command failed unexpectedly" >&2
782 test_done
"$testroot" "$ret"
786 got branch
-r $testroot/repo
-c $commit_id foo
787 got ref
-r $testroot/repo
-c $commit_id refs
/hoo
/boo
/zoo
788 got tag
-r $testroot/repo
-c $commit_id -m tag
"1.0" >/dev
/null
789 local tag_id
=`got ref -r $testroot/repo -l \
790 | grep "^refs/tags/$tag" | tr -d ' ' | cut -d: -f2`
792 echo "modified alpha on master" > $testroot/repo
/alpha
793 git_commit
$testroot/repo
-m "modified alpha"
794 local commit_id2
=`git_show_head $testroot/repo`
796 (cd $testroot/repo
&& git checkout
-q foo
)
797 echo "modified alpha on foo" > $testroot/repo
/alpha
798 git_commit
$testroot/repo
-m "modified alpha"
799 local commit_id3
=`git_show_head $testroot/repo`
800 (cd $testroot/repo
&& git checkout
-q master
)
802 got fetch
-q -r $testroot/repo-clone
-R refs
/remotes
/origin
/main \
803 > $testroot/stdout
2> $testroot/stderr
805 if [ $ret -eq 0 ]; then
806 echo "got fetch command succeeded unexpectedly" >&2
807 test_done
"$testroot" "1"
811 echo -n > $testroot/stdout.expected
813 cmp -s $testroot/stdout
$testroot/stdout.expected
815 if [ $ret -ne 0 ]; then
816 diff -u $testroot/stdout.expected
$testroot/stdout
817 test_done
"$testroot" "$ret"
821 echo "got: refs/remotes/origin/main: reference cannot be fetched" \
822 > $testroot/stderr.expected
824 cmp -s $testroot/stderr
$testroot/stderr.expected
826 if [ $ret -ne 0 ]; then
827 diff -u $testroot/stderr.expected
$testroot/stderr
828 test_done
"$testroot" "$ret"
832 got fetch
-q -r $testroot/repo-clone
-R refs
/hoo
834 if [ $ret -ne 0 ]; then
835 echo "got fetch command failed unexpectedly" >&2
836 test_done
"$testroot" "$ret"
840 got ref
-l -r $testroot/repo-clone
> $testroot/stdout
842 echo "HEAD: refs/heads/master" > $testroot/stdout.expected
843 echo "refs/heads/master: $commit_id" >> $testroot/stdout.expected
844 echo "refs/remotes/origin/HEAD: refs/remotes/origin/master" \
845 >> $testroot/stdout.expected
846 echo "refs/remotes/origin/hoo/boo/zoo: $commit_id" \
847 >> $testroot/stdout.expected
848 echo "refs/remotes/origin/master: $commit_id2" \
849 >> $testroot/stdout.expected
850 echo "refs/tags/1.0: $tag_id" >> $testroot/stdout.expected
852 cmp -s $testroot/stdout
$testroot/stdout.expected
854 if [ $ret -ne 0 ]; then
855 diff -u $testroot/stdout.expected
$testroot/stdout
857 test_done
"$testroot" "$ret"
861 test_fetch_replace_symref
() {
862 local testroot
=`test_init fetch_replace_symref`
863 local testurl
=ssh://127.0.0.1/$testroot
864 local commit_id
=`git_show_head $testroot/repo`
866 got clone
-m -q $testurl/repo
$testroot/repo-clone
868 if [ $ret -ne 0 ]; then
869 echo "got clone command failed unexpectedly" >&2
870 test_done
"$testroot" "$ret"
874 got ref
-r $testroot/repo
-c $commit_id refs
/hoo
/boo
/zoo
875 got ref
-r $testroot/repo-clone
-s refs
/heads
/master refs
/hoo
/boo
/zoo
877 got ref
-l -r $testroot/repo-clone
> $testroot/stdout
879 echo "HEAD: refs/heads/master" > $testroot/stdout.expected
880 echo "refs/heads/master: $commit_id" >> $testroot/stdout.expected
881 echo "refs/hoo/boo/zoo: refs/heads/master" >> $testroot/stdout.expected
883 cmp -s $testroot/stdout
$testroot/stdout.expected
885 if [ $ret -ne 0 ]; then
886 diff -u $testroot/stdout.expected
$testroot/stdout
887 test_done
"$testroot" "$ret"
891 got fetch
-r $testroot/repo-clone
-R refs
/hoo \
892 2> $testroot/stderr |
grep ^Replacing
> $testroot/stdout
894 if [ $ret -ne 0 ]; then
895 echo "got fetch command failed unexpectedly" >&2
896 test_done
"$testroot" "$ret"
900 echo "Replacing reference refs/hoo/boo/zoo: refs/heads/master" \
901 > $testroot/stdout.expected
903 cmp -s $testroot/stdout
$testroot/stdout.expected
905 if [ $ret -ne 0 ]; then
906 diff -u $testroot/stdout.expected
$testroot/stdout
907 test_done
"$testroot" "$ret"
911 got ref
-l -r $testroot/repo-clone
> $testroot/stdout
913 echo "HEAD: refs/heads/master" > $testroot/stdout.expected
914 echo "refs/heads/master: $commit_id" >> $testroot/stdout.expected
915 echo "refs/hoo/boo/zoo: $commit_id" >> $testroot/stdout.expected
917 cmp -s $testroot/stdout
$testroot/stdout.expected
919 if [ $ret -ne 0 ]; then
920 diff -u $testroot/stdout.expected
$testroot/stdout
922 test_done
"$testroot" "$ret"
926 test_fetch_update_headref
() {
927 local testroot
=`test_init fetch_update_headref`
928 local testurl
=ssh://127.0.0.1/$testroot
929 local commit_id
=`git_show_head $testroot/repo`
931 got clone
-q $testurl/repo
$testroot/repo-clone
933 if [ $ret -ne 0 ]; then
934 echo "got clone command failed unexpectedly" >&2
935 test_done
"$testroot" "$ret"
939 got ref
-l -r $testroot/repo-clone
> $testroot/stdout
941 echo "HEAD: refs/heads/master" > $testroot/stdout.expected
942 echo "refs/heads/master: $commit_id" >> $testroot/stdout.expected
943 echo "refs/remotes/origin/HEAD: refs/remotes/origin/master" \
944 >> $testroot/stdout.expected
945 echo "refs/remotes/origin/master: $commit_id" \
946 >> $testroot/stdout.expected
948 cmp -s $testroot/stdout
$testroot/stdout.expected
950 if [ $ret -ne 0 ]; then
951 diff -u $testroot/stdout.expected
$testroot/stdout
952 test_done
"$testroot" "$ret"
956 got ref
-r $testroot/repo
-c refs
/heads
/master refs
/heads
/foo
957 got ref
-r $testroot/repo
-s refs
/heads
/foo HEAD
958 got ref
-l -r $testroot/repo
> $testroot/stdout
960 echo "HEAD: refs/heads/foo" > $testroot/stdout.expected
961 echo "refs/heads/foo: $commit_id" >> $testroot/stdout.expected
962 echo "refs/heads/master: $commit_id" >> $testroot/stdout.expected
964 cmp -s $testroot/stdout
$testroot/stdout.expected
966 if [ $ret -ne 0 ]; then
967 diff -u $testroot/stdout.expected
$testroot/stdout
968 test_done
"$testroot" "$ret"
972 got fetch
-q -r $testroot/repo-clone
974 got ref
-l -r $testroot/repo-clone
> $testroot/stdout
976 echo "HEAD: refs/heads/master" > $testroot/stdout.expected
977 echo "refs/heads/master: $commit_id" >> $testroot/stdout.expected
978 echo "refs/remotes/origin/HEAD: refs/remotes/origin/master" \
979 >> $testroot/stdout.expected
980 echo "refs/remotes/origin/master: $commit_id" \
981 >> $testroot/stdout.expected
983 cmp -s $testroot/stdout
$testroot/stdout.expected
985 if [ $ret -ne 0 ]; then
986 diff -u $testroot/stdout.expected
$testroot/stdout
987 test_done
"$testroot" "$ret"
991 got fetch
-q -r $testroot/repo-clone
-a
993 got ref
-l -r $testroot/repo-clone
> $testroot/stdout
995 echo "HEAD: refs/heads/master" > $testroot/stdout.expected
996 echo "refs/heads/foo: $commit_id" >> $testroot/stdout.expected
997 echo "refs/heads/master: $commit_id" >> $testroot/stdout.expected
998 echo "refs/remotes/origin/HEAD: refs/remotes/origin/foo" \
999 >> $testroot/stdout.expected
1000 echo "refs/remotes/origin/foo: $commit_id" \
1001 >> $testroot/stdout.expected
1002 echo "refs/remotes/origin/master: $commit_id" \
1003 >> $testroot/stdout.expected
1005 cmp -s $testroot/stdout
$testroot/stdout.expected
1007 if [ $ret -ne 0 ]; then
1008 diff -u $testroot/stdout.expected
$testroot/stdout
1010 test_done
"$testroot" "$ret"
1013 test_fetch_headref_deleted_locally
() {
1014 local testroot
=`test_init fetch_headref_deleted_locally`
1015 local testurl
=ssh://127.0.0.1/$testroot
1016 local commit_id
=`git_show_head $testroot/repo`
1018 got clone
-q $testurl/repo
$testroot/repo-clone
1020 if [ $ret -ne 0 ]; then
1021 echo "got clone command failed unexpectedly" >&2
1022 test_done
"$testroot" "$ret"
1026 got ref
-l -r $testroot/repo-clone
> $testroot/stdout
1028 echo "HEAD: refs/heads/master" > $testroot/stdout.expected
1029 echo "refs/heads/master: $commit_id" >> $testroot/stdout.expected
1030 echo "refs/remotes/origin/HEAD: refs/remotes/origin/master" \
1031 >> $testroot/stdout.expected
1032 echo "refs/remotes/origin/master: $commit_id" \
1033 >> $testroot/stdout.expected
1035 cmp -s $testroot/stdout
$testroot/stdout.expected
1037 if [ $ret -ne 0 ]; then
1038 diff -u $testroot/stdout.expected
$testroot/stdout
1039 test_done
"$testroot" "$ret"
1043 got ref
-r $testroot/repo-clone
-d refs
/remotes
/origin
/HEAD
> /dev
/null
1045 got fetch
-q -r $testroot/repo-clone
1047 if [ $ret -ne 0 ]; then
1048 echo "got fetch command failed unexpectedly" >&2
1049 test_done
"$testroot" "$ret"
1052 got ref
-l -r $testroot/repo-clone
> $testroot/stdout
1054 echo "HEAD: refs/heads/master" > $testroot/stdout.expected
1055 echo "refs/heads/master: $commit_id" >> $testroot/stdout.expected
1056 # refs/remotes/origin/HEAD has been restored:
1057 echo "refs/remotes/origin/HEAD: refs/remotes/origin/master" \
1058 >> $testroot/stdout.expected
1059 echo "refs/remotes/origin/master: $commit_id" \
1060 >> $testroot/stdout.expected
1062 cmp -s $testroot/stdout
$testroot/stdout.expected
1064 if [ $ret -ne 0 ]; then
1065 diff -u $testroot/stdout.expected
$testroot/stdout
1067 test_done
"$testroot" "$ret"
1070 test_fetch_gotconfig_remote_repo
() {
1071 local testroot
=`test_init fetch_gotconfig_remote_repo`
1072 local testurl
=ssh://127.0.0.1/$testroot
1073 local commit_id
=`git_show_head $testroot/repo`
1075 got branch
-r $testroot/repo
-c $commit_id foo
1076 got ref
-r $testroot/repo
-c $commit_id refs
/hoo
/boo
/zoo
1077 got tag
-r $testroot/repo
-c $commit_id -m tag
"1.0" >/dev
/null
1079 got clone
-q $testurl/repo
$testroot/repo-clone
1081 if [ $ret -ne 0 ]; then
1082 echo "got clone command failed unexpectedly" >&2
1083 test_done
"$testroot" "$ret"
1087 cat > $testroot/repo-clone
/got.conf
<<EOF
1091 repository "$testroot/repo"
1097 repository "$testroot/does-not-exist"
1100 echo "got: nonexistent: remote repository not found" \
1101 > $testroot/stderr.expected
1102 (cd $testroot/repo-clone
&& got fetch
-q nonexistent \
1103 > $testroot/stdout
2> $testroot/stderr
)
1105 if [ $ret -eq 0 ]; then
1106 echo "got fetch command succeeded unexpectedly" >&2
1107 diff -u $testroot/stderr.expected
$testroot/stderr
1108 test_done
"$testroot" "1"
1112 (cd $testroot/repo-clone
&& got fetch
-q -l foobar \
1115 if [ $ret -ne 0 ]; then
1116 echo "got fetch command failed unexpectedly" >&2
1117 test_done
"$testroot" "$ret"
1121 got ref
-l -r $testroot/repo
> $testroot/stdout.expected
1123 cmp -s $testroot/stdout
$testroot/stdout.expected
1125 if [ $ret -ne 0 ]; then
1126 diff -u $testroot/stdout.expected
$testroot/stdout
1127 test_done
"$testroot" "$ret"
1131 got checkout
$testroot/repo
$testroot/wt
> /dev
/null
1133 cat > $testroot/wt
/.got
/got.conf
<<EOF
1137 repository "$testroot/repo"
1140 (cd $testroot/wt
&& got fetch
-q -l barbaz
> $testroot/stdout
)
1142 if [ $ret -ne 0 ]; then
1143 echo "got fetch command failed unexpectedly" >&2
1144 test_done
"$testroot" "$ret"
1148 got ref
-l -r $testroot/repo
> $testroot/stdout.expected
1150 cmp -s $testroot/stdout
$testroot/stdout.expected
1152 if [ $ret -ne 0 ]; then
1153 diff -u $testroot/stdout.expected
$testroot/stdout
1154 test_done
"$testroot" "$ret"
1158 cat > $testroot/repo-clone
/got.conf
<<EOF
1162 repository "$testroot/repo"
1164 reference { "hoo/boo/zoo" }
1167 (cd $testroot/repo-clone
&& got fetch
-q > $testroot/stdout
)
1169 local tag_id
=`got ref -r $testroot/repo -l \
1170 | grep "^refs/tags/1.0" | tr -d ' ' | cut -d: -f2`
1171 echo "HEAD: refs/heads/master" > $testroot/stdout.expected
1172 echo "refs/heads/foo: $commit_id" >> $testroot/stdout.expected
1173 echo "refs/heads/master: $commit_id" >> $testroot/stdout.expected
1174 echo "refs/remotes/origin/HEAD: refs/remotes/origin/master" \
1175 >> $testroot/stdout.expected
1176 echo "refs/remotes/origin/foo: $commit_id" \
1177 >> $testroot/stdout.expected
1178 echo "refs/remotes/origin/hoo/boo/zoo: $commit_id" \
1179 >> $testroot/stdout.expected
1180 echo "refs/remotes/origin/master: $commit_id" \
1181 >> $testroot/stdout.expected
1182 echo "refs/tags/1.0: $tag_id" >> $testroot/stdout.expected
1184 got ref
-l -r $testroot/repo-clone
> $testroot/stdout
1186 cmp -s $testroot/stdout
$testroot/stdout.expected
1188 if [ $ret -ne 0 ]; then
1189 diff -u $testroot/stdout.expected
$testroot/stdout
1191 test_done
"$testroot" "$ret"
1194 test_fetch_delete_remote_refs
() {
1195 local testroot
=`test_init fetch_delete_remote_refs`
1196 local testurl
=ssh://127.0.0.1/$testroot
1197 local commit_id
=`git_show_head $testroot/repo`
1199 got clone
-q $testurl/repo
$testroot/repo-clone
1201 if [ $ret -ne 0 ]; then
1202 echo "got clone command failed unexpectedly" >&2
1203 test_done
"$testroot" "$ret"
1207 got ref
-l -r $testroot/repo-clone
> $testroot/stdout
1209 if [ $ret -ne 0 ]; then
1210 echo "got ref command failed unexpectedly" >&2
1211 test_done
"$testroot" "$ret"
1215 echo "HEAD: refs/heads/master" > $testroot/stdout.expected
1216 echo "refs/heads/master: $commit_id" >> $testroot/stdout.expected
1217 echo "refs/remotes/origin/HEAD: refs/remotes/origin/master" \
1218 >> $testroot/stdout.expected
1219 echo "refs/remotes/origin/master: $commit_id" \
1220 >> $testroot/stdout.expected
1222 cmp -s $testroot/stdout
$testroot/stdout.expected
1224 if [ $ret -ne 0 ]; then
1225 diff -u $testroot/stdout.expected
$testroot/stdout
1226 test_done
"$testroot" "$ret"
1230 got fetch
-q -r $testroot/repo-clone
-X > $testroot/stdout \
1233 if [ $ret -eq 0 ]; then
1234 echo "got fetch command succeeded unexpectedly" >&2
1235 test_done
"$testroot" "$ret"
1239 echo "got: -X option requires a remote name" > $testroot/stderr.expected
1240 cmp -s $testroot/stderr
$testroot/stderr.expected
1242 if [ $ret -ne 0 ]; then
1243 diff -u $testroot/stderr.expected
$testroot/stderr
1244 test_done
"$testroot" "$ret"
1248 got fetch
-q -r $testroot/repo-clone
-X origin
> $testroot/stdout \
1251 if [ $ret -ne 0 ]; then
1252 echo "got fetch command failed unexpectedly" >&2
1253 test_done
"$testroot" "$ret"
1257 echo -n "Deleted refs/remotes/origin/HEAD: " > $testroot/stdout.expected
1258 echo "refs/remotes/origin/master" >> $testroot/stdout.expected
1259 echo "Deleted refs/remotes/origin/master: $commit_id" \
1260 >> $testroot/stdout.expected
1262 cmp -s $testroot/stdout
$testroot/stdout.expected
1264 if [ $ret -ne 0 ]; then
1265 diff -u $testroot/stdout.expected
$testroot/stdout
1266 test_done
"$testroot" "$ret"
1270 got ref
-l -r $testroot/repo-clone
> $testroot/stdout
1272 if [ $ret -ne 0 ]; then
1273 echo "got ref command failed unexpectedly" >&2
1274 test_done
"$testroot" "$ret"
1278 echo "HEAD: refs/heads/master" > $testroot/stdout.expected
1279 echo "refs/heads/master: $commit_id" >> $testroot/stdout.expected
1281 cmp -s $testroot/stdout
$testroot/stdout.expected
1283 if [ $ret -ne 0 ]; then
1284 diff -u $testroot/stdout.expected
$testroot/stdout
1286 test_done
"$testroot" "$ret"
1291 run_test test_fetch_basic
1292 run_test test_fetch_list
1293 run_test test_fetch_branch
1294 run_test test_fetch_all
1295 run_test test_fetch_empty_packfile
1296 run_test test_fetch_delete_branch
1297 run_test test_fetch_delete_branch_mirror
1298 run_test test_fetch_update_tag
1299 run_test test_fetch_reference
1300 run_test test_fetch_replace_symref
1301 run_test test_fetch_update_headref
1302 run_test test_fetch_headref_deleted_locally
1303 run_test test_fetch_gotconfig_remote_repo
1304 run_test test_fetch_delete_remote_refs