Blob


1 #!/bin/sh
2 #
3 # Copyright (c) 2020 Stefan Sperling <stsp@openbsd.org>
4 #
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.
8 #
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.
17 . ./common.sh
19 test_clone_basic() {
20 local testroot=`test_init clone_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
25 ret="$?"
26 if [ "$ret" != "0" ]; then
27 echo "got clone command failed unexpectedly" >&2
28 test_done "$testroot" "$ret"
29 return 1
30 fi
32 got log -l0 -p -r $testroot/repo > $testroot/log-repo
33 if [ "$ret" != "0" ]; then
34 echo "got log command failed unexpectedly" >&2
35 test_done "$testroot" "$ret"
36 return 1
37 fi
38 got log -l0 -p -r $testroot/repo > $testroot/log-repo-clone
39 if [ "$ret" != "0" ]; then
40 echo "got log command failed unexpectedly" >&2
41 test_done "$testroot" "$ret"
42 return 1
43 fi
44 cmp -s $testroot/log-repo $testroot/log-repo-clone
45 ret="$?"
46 if [ "$ret" != "0" ]; then
47 echo "log -p output of cloned repository differs" >&2
48 test_done "$testroot" "$ret"
49 return 1
50 fi
52 got ref -l -r $testroot/repo > $testroot/stdout
53 if [ "$ret" != "0" ]; then
54 echo "got ref command failed unexpectedly" >&2
55 test_done "$testroot" "$ret"
56 return 1
57 fi
59 echo "HEAD: refs/heads/master" > $testroot/stdout.expected
60 echo "refs/heads/master: $commit_id" >> $testroot/stdout.expected
62 cmp -s $testroot/stdout $testroot/stdout.expected
63 ret="$?"
64 if [ "$ret" != "0" ]; then
65 diff -u $testroot/stdout.expected $testroot/stdout
66 test_done "$testroot" "$ret"
67 return 1
68 fi
70 got ref -l -r $testroot/repo-clone > $testroot/stdout
71 if [ "$ret" != "0" ]; then
72 echo "got ref command failed unexpectedly" >&2
73 test_done "$testroot" "$ret"
74 return 1
75 fi
77 echo "HEAD: refs/heads/master" > $testroot/stdout.expected
78 echo "refs/heads/master: $commit_id" >> $testroot/stdout.expected
79 echo "refs/remotes/origin/HEAD: refs/remotes/origin/master" \
80 >> $testroot/stdout.expected
81 echo "refs/remotes/origin/master: $commit_id" \
82 >> $testroot/stdout.expected
84 cmp -s $testroot/stdout $testroot/stdout.expected
85 ret="$?"
86 if [ "$ret" != "0" ]; then
87 diff -u $testroot/stdout.expected $testroot/stdout
88 test_done "$testroot" "$ret"
89 return 1
90 fi
92 cat > $testroot/got.conf.expected <<EOF
93 remote "origin" {
94 server 127.0.0.1
95 protocol ssh
96 repository "$testroot/repo"
97 branch { "master" }
98 }
99 EOF
100 cmp -s $testroot/repo-clone/got.conf $testroot/got.conf.expected
101 ret="$?"
102 if [ "$ret" != "0" ]; then
103 diff -u $testroot/got.conf.expected \
104 $testroot/repo-clone/got.conf
105 test_done "$testroot" "$ret"
106 return 1
107 fi
109 cat > $testroot/config.expected <<EOF
110 [core]
111 repositoryformatversion = 0
112 filemode = true
113 bare = true
115 [remote "origin"]
116 url = ssh://127.0.0.1$testroot/repo
117 fetch = +refs/heads/master:refs/remotes/origin/master
118 EOF
119 cmp -s $testroot/repo-clone/config $testroot/config.expected
120 ret="$?"
121 if [ "$ret" != "0" ]; then
122 diff -u $testroot/config.expected \
123 $testroot/repo-clone/config
124 fi
125 test_done "$testroot" "$ret"
128 test_clone_list() {
129 local testroot=`test_init clone_list`
130 local testurl=ssh://127.0.0.1/$testroot
131 local commit_id=`git_show_head $testroot/repo`
133 got branch -r $testroot/repo -c $commit_id foo
134 got ref -r $testroot/repo -c $commit_id refs/hoo/boo/zoo
135 got tag -r $testroot/repo -c $commit_id -m tag "1.0" >/dev/null
137 got clone -l $testurl/repo > $testroot/stdout 2>$testroot/stderr
138 ret="$?"
139 if [ "$ret" != "0" ]; then
140 echo "got clone command failed unexpectedly" >&2
141 test_done "$testroot" "$ret"
142 return 1
143 fi
145 echo "Connecting to 127.0.0.1" > $testroot/stdout.expected
146 got ref -l -r $testroot/repo >> $testroot/stdout.expected
148 cmp -s $testroot/stdout $testroot/stdout.expected
149 ret="$?"
150 if [ "$ret" != "0" ]; then
151 diff -u $testroot/stdout.expected $testroot/stdout
152 fi
153 test_done "$testroot" "$ret"
156 test_clone_branch() {
157 local testroot=`test_init clone_branch`
158 local testurl=ssh://127.0.0.1/$testroot
159 local commit_id=`git_show_head $testroot/repo`
161 got branch -r $testroot/repo -c $commit_id foo
162 got ref -r $testroot/repo -c $commit_id refs/hoo/boo/zoo
163 got tag -r $testroot/repo -c $commit_id -m tag "1.0" >/dev/null
164 local tag_id=`got ref -r $testroot/repo -l \
165 | grep "^refs/tags/$tag" | tr -d ' ' | cut -d: -f2`
167 got clone -q -b foo $testurl/repo $testroot/repo-clone
168 ret="$?"
169 if [ "$ret" != "0" ]; then
170 echo "got clone command failed unexpectedly" >&2
171 test_done "$testroot" "$ret"
172 return 1
173 fi
175 got ref -l -r $testroot/repo-clone > $testroot/stdout
177 echo "HEAD: refs/heads/foo" > $testroot/stdout.expected
178 echo "refs/heads/foo: $commit_id" >> $testroot/stdout.expected
179 # refs/heads/master is missing because it wasn't passed via -b
180 echo "refs/remotes/origin/foo: $commit_id" >> $testroot/stdout.expected
181 # refs/hoo/boo/zoo is missing because it is outside of refs/heads
182 echo "refs/tags/1.0: $tag_id" >> $testroot/stdout.expected
184 cmp -s $testroot/stdout $testroot/stdout.expected
185 ret="$?"
186 if [ "$ret" != "0" ]; then
187 diff -u $testroot/stdout.expected $testroot/stdout
188 test_done "$testroot" "$ret"
189 return 1
190 fi
192 cat > $testroot/got.conf.expected <<EOF
193 remote "origin" {
194 server 127.0.0.1
195 protocol ssh
196 repository "$testroot/repo"
197 branch { "foo" }
199 EOF
200 cmp -s $testroot/repo-clone/got.conf $testroot/got.conf.expected
201 ret="$?"
202 if [ "$ret" != "0" ]; then
203 diff -u $testroot/got.conf.expected \
204 $testroot/repo-clone/got.conf
205 test_done "$testroot" "$ret"
206 return 1
207 fi
209 cat > $testroot/config.expected <<EOF
210 [core]
211 repositoryformatversion = 0
212 filemode = true
213 bare = true
215 [remote "origin"]
216 url = ssh://127.0.0.1$testroot/repo
217 fetch = +refs/heads/foo:refs/remotes/origin/foo
218 EOF
219 cmp -s $testroot/repo-clone/config $testroot/config.expected
220 ret="$?"
221 if [ "$ret" != "0" ]; then
222 diff -u $testroot/config.expected \
223 $testroot/repo-clone/config
224 fi
225 test_done "$testroot" "$ret"
228 test_clone_all() {
229 local testroot=`test_init clone_all`
230 local testurl=ssh://127.0.0.1/$testroot
231 local commit_id=`git_show_head $testroot/repo`
233 got branch -r $testroot/repo -c $commit_id foo
234 got ref -r $testroot/repo -c $commit_id refs/hoo/boo/zoo
235 got tag -r $testroot/repo -c $commit_id -m tag "1.0" >/dev/null
236 local tag_id=`got ref -r $testroot/repo -l \
237 | grep "^refs/tags/$tag" | tr -d ' ' | cut -d: -f2`
239 got clone -q -a $testurl/repo $testroot/repo-clone
240 ret="$?"
241 if [ "$ret" != "0" ]; then
242 echo "got clone command failed unexpectedly" >&2
243 test_done "$testroot" "$ret"
244 return 1
245 fi
247 got ref -l -r $testroot/repo-clone > $testroot/stdout
249 echo "HEAD: refs/heads/master" > $testroot/stdout.expected
250 echo "refs/heads/foo: $commit_id" >> $testroot/stdout.expected
251 echo "refs/heads/master: $commit_id" >> $testroot/stdout.expected
252 echo "refs/remotes/origin/HEAD: refs/remotes/origin/master" \
253 >> $testroot/stdout.expected
254 echo "refs/remotes/origin/foo: $commit_id" >> $testroot/stdout.expected
255 echo "refs/remotes/origin/master: $commit_id" \
256 >> $testroot/stdout.expected
257 # refs/hoo/boo/zoo is missing because it is outside of refs/heads
258 echo "refs/tags/1.0: $tag_id" >> $testroot/stdout.expected
260 cmp -s $testroot/stdout $testroot/stdout.expected
261 ret="$?"
262 if [ "$ret" != "0" ]; then
263 diff -u $testroot/stdout.expected $testroot/stdout
264 test_done "$testroot" "$ret"
265 return 1
266 fi
268 cat > $testroot/got.conf.expected <<EOF
269 remote "origin" {
270 server 127.0.0.1
271 protocol ssh
272 repository "$testroot/repo"
273 branch { "master" }
275 EOF
276 cmp -s $testroot/repo-clone/got.conf $testroot/got.conf.expected
277 ret="$?"
278 if [ "$ret" != "0" ]; then
279 diff -u $testroot/got.conf.expected \
280 $testroot/repo-clone/got.conf
281 test_done "$testroot" "$ret"
282 return 1
283 fi
285 cat > $testroot/config.expected <<EOF
286 [core]
287 repositoryformatversion = 0
288 filemode = true
289 bare = true
291 [remote "origin"]
292 url = ssh://127.0.0.1$testroot/repo
293 fetch = +refs/heads/*:refs/remotes/origin/*
294 EOF
295 cmp -s $testroot/repo-clone/config $testroot/config.expected
296 ret="$?"
297 if [ "$ret" != "0" ]; then
298 diff -u $testroot/config.expected \
299 $testroot/repo-clone/config
300 fi
301 test_done "$testroot" "$ret"
304 test_clone_mirror() {
305 local testroot=`test_init clone_mirror`
306 local testurl=ssh://127.0.0.1/$testroot
307 local commit_id=`git_show_head $testroot/repo`
309 got branch -r $testroot/repo -c $commit_id foo
310 got ref -r $testroot/repo -c $commit_id refs/hoo/boo/zoo
311 got tag -r $testroot/repo -c $commit_id -m tag "1.0" >/dev/null
312 local tag_id=`got ref -r $testroot/repo -l \
313 | grep "^refs/tags/$tag" | tr -d ' ' | cut -d: -f2`
315 got clone -q -m $testurl/repo $testroot/repo-clone
316 ret="$?"
317 if [ "$ret" != "0" ]; then
318 echo "got clone command failed unexpectedly" >&2
319 test_done "$testroot" "$ret"
320 return 1
321 fi
323 got ref -l -r $testroot/repo-clone > $testroot/stdout
325 echo "HEAD: refs/heads/master" > $testroot/stdout.expected
326 # refs/heads/foo is missing because we're not fetching all branches
327 echo "refs/heads/master: $commit_id" >> $testroot/stdout.expected
328 # refs/hoo/boo/zoo is missing because it is outside of refs/heads
329 echo "refs/tags/1.0: $tag_id" >> $testroot/stdout.expected
331 cmp -s $testroot/stdout $testroot/stdout.expected
332 ret="$?"
333 if [ "$ret" != "0" ]; then
334 diff -u $testroot/stdout.expected $testroot/stdout
335 test_done "$testroot" "$ret"
336 return 1
337 fi
339 cat > $testroot/got.conf.expected <<EOF
340 remote "origin" {
341 server 127.0.0.1
342 protocol ssh
343 repository "$testroot/repo"
344 branch { "master" }
345 mirror-references yes
347 EOF
348 cmp -s $testroot/repo-clone/got.conf $testroot/got.conf.expected
349 ret="$?"
350 if [ "$ret" != "0" ]; then
351 diff -u $testroot/got.conf.expected \
352 $testroot/repo-clone/got.conf
353 test_done "$testroot" "$ret"
354 return 1
355 fi
357 cat > $testroot/config.expected <<EOF
358 [core]
359 repositoryformatversion = 0
360 filemode = true
361 bare = true
363 [remote "origin"]
364 url = ssh://127.0.0.1$testroot/repo
365 fetch = +refs/*:refs/*
366 mirror = true
367 EOF
368 cmp -s $testroot/repo-clone/config $testroot/config.expected
369 ret="$?"
370 if [ "$ret" != "0" ]; then
371 diff -u $testroot/config.expected \
372 $testroot/repo-clone/config
373 fi
374 test_done "$testroot" "$ret"
377 test_clone_mirror_all() {
378 local testroot=`test_init clone_mirror_all`
379 local testurl=ssh://127.0.0.1/$testroot
380 local commit_id=`git_show_head $testroot/repo`
382 got branch -r $testroot/repo -c $commit_id foo
383 got ref -r $testroot/repo -c $commit_id refs/hoo/boo/zoo
384 got tag -r $testroot/repo -c $commit_id -m tag "1.0" >/dev/null
385 local tag_id=`got ref -r $testroot/repo -l \
386 | grep "^refs/tags/$tag" | tr -d ' ' | cut -d: -f2`
388 got clone -q -m -a $testurl/repo $testroot/repo-clone
389 ret="$?"
390 if [ "$ret" != "0" ]; then
391 echo "got clone command failed unexpectedly" >&2
392 test_done "$testroot" "$ret"
393 return 1
394 fi
396 got ref -l -r $testroot/repo-clone > $testroot/stdout
398 echo "HEAD: refs/heads/master" > $testroot/stdout.expected
399 echo "refs/heads/foo: $commit_id" >> $testroot/stdout.expected
400 echo "refs/heads/master: $commit_id" >> $testroot/stdout.expected
401 # refs/hoo/boo/zoo is missing because it is outside of refs/heads
402 echo "refs/tags/1.0: $tag_id" >> $testroot/stdout.expected
404 cmp -s $testroot/stdout $testroot/stdout.expected
405 ret="$?"
406 if [ "$ret" != "0" ]; then
407 diff -u $testroot/stdout.expected $testroot/stdout
408 test_done "$testroot" "$ret"
409 return 1
410 fi
412 cat > $testroot/got.conf.expected <<EOF
413 remote "origin" {
414 server 127.0.0.1
415 protocol ssh
416 repository "$testroot/repo"
417 branch { "master" }
418 mirror-references yes
420 EOF
421 cmp -s $testroot/repo-clone/got.conf $testroot/got.conf.expected
422 ret="$?"
423 if [ "$ret" != "0" ]; then
424 diff -u $testroot/got.conf.expected \
425 $testroot/repo-clone/got.conf
426 test_done "$testroot" "$ret"
427 return 1
428 fi
430 cat > $testroot/config.expected <<EOF
431 [core]
432 repositoryformatversion = 0
433 filemode = true
434 bare = true
436 [remote "origin"]
437 url = ssh://127.0.0.1$testroot/repo
438 fetch = +refs/*:refs/*
439 mirror = true
440 EOF
441 cmp -s $testroot/repo-clone/config $testroot/config.expected
442 ret="$?"
443 if [ "$ret" != "0" ]; then
444 diff -u $testroot/config.expected \
445 $testroot/repo-clone/config
446 fi
447 test_done "$testroot" "$ret"
450 test_clone_reference() {
451 local testroot=`test_init clone_reference`
452 local testurl=ssh://127.0.0.1/$testroot
453 local commit_id=`git_show_head $testroot/repo`
455 got branch -r $testroot/repo -c $commit_id foo
456 got ref -r $testroot/repo -c $commit_id refs/hoo/boo/zoo
457 got tag -r $testroot/repo -c $commit_id -m tag "1.0" >/dev/null
458 local tag_id=`got ref -r $testroot/repo -l \
459 | grep "^refs/tags/$tag" | tr -d ' ' | cut -d: -f2`
461 got clone -q -R hoo $testurl/repo $testroot/repo-clone
462 ret="$?"
463 if [ "$ret" != "0" ]; then
464 echo "got clone command failed unexpectedly" >&2
465 test_done "$testroot" "$ret"
466 return 1
467 fi
469 got ref -l -r $testroot/repo-clone > $testroot/stdout
471 echo "HEAD: refs/heads/master" > $testroot/stdout.expected
472 echo "refs/heads/master: $commit_id" >> $testroot/stdout.expected
473 echo "refs/remotes/origin/HEAD: refs/remotes/origin/master" \
474 >> $testroot/stdout.expected
475 echo "refs/remotes/origin/hoo/boo/zoo: $commit_id" \
476 >> $testroot/stdout.expected
477 echo "refs/remotes/origin/master: $commit_id" \
478 >> $testroot/stdout.expected
479 echo "refs/tags/1.0: $tag_id" >> $testroot/stdout.expected
481 cmp -s $testroot/stdout $testroot/stdout.expected
482 ret="$?"
483 if [ "$ret" != "0" ]; then
484 diff -u $testroot/stdout.expected $testroot/stdout
485 test_done "$testroot" "$ret"
486 return 1
487 fi
489 cat > $testroot/got.conf.expected <<EOF
490 remote "origin" {
491 server 127.0.0.1
492 protocol ssh
493 repository "$testroot/repo"
494 branch { "master" }
496 EOF
497 cmp -s $testroot/repo-clone/got.conf $testroot/got.conf.expected
498 ret="$?"
499 if [ "$ret" != "0" ]; then
500 diff -u $testroot/got.conf.expected \
501 $testroot/repo-clone/got.conf
502 test_done "$testroot" "$ret"
503 return 1
504 fi
506 cat > $testroot/config.expected <<EOF
507 [core]
508 repositoryformatversion = 0
509 filemode = true
510 bare = true
512 [remote "origin"]
513 url = ssh://127.0.0.1$testroot/repo
514 fetch = +refs/heads/master:refs/remotes/origin/master
515 EOF
516 cmp -s $testroot/repo-clone/config $testroot/config.expected
517 ret="$?"
518 if [ "$ret" != "0" ]; then
519 diff -u $testroot/config.expected \
520 $testroot/repo-clone/config
521 fi
522 test_done "$testroot" "$ret"
525 test_clone_branch_and_reference() {
526 local testroot=`test_init clone_reference`
527 local testurl=ssh://127.0.0.1/$testroot
528 local commit_id=`git_show_head $testroot/repo`
530 got branch -r $testroot/repo -c $commit_id foo
531 got ref -r $testroot/repo -c $commit_id refs/hoo/boo/zoo
532 got tag -r $testroot/repo -c $commit_id -m tag "1.0" >/dev/null
533 local tag_id=`got ref -r $testroot/repo -l \
534 | grep "^refs/tags/$tag" | tr -d ' ' | cut -d: -f2`
536 got clone -q -R hoo/boo/zoo -b foo $testurl/repo $testroot/repo-clone
537 ret="$?"
538 if [ "$ret" != "0" ]; then
539 echo "got clone command failed unexpectedly" >&2
540 test_done "$testroot" "$ret"
541 return 1
542 fi
544 got ref -l -r $testroot/repo-clone > $testroot/stdout
546 echo "HEAD: refs/heads/foo" > $testroot/stdout.expected
547 echo "refs/heads/foo: $commit_id" >> $testroot/stdout.expected
548 echo "refs/remotes/origin/foo: $commit_id" \
549 >> $testroot/stdout.expected
550 echo "refs/remotes/origin/hoo/boo/zoo: $commit_id" \
551 >> $testroot/stdout.expected
552 echo "refs/tags/1.0: $tag_id" >> $testroot/stdout.expected
554 cmp -s $testroot/stdout $testroot/stdout.expected
555 ret="$?"
556 if [ "$ret" != "0" ]; then
557 diff -u $testroot/stdout.expected $testroot/stdout
558 test_done "$testroot" "$ret"
559 return 1
560 fi
562 cat > $testroot/got.conf.expected <<EOF
563 remote "origin" {
564 server 127.0.0.1
565 protocol ssh
566 repository "$testroot/repo"
567 branch { "foo" }
569 EOF
570 cmp -s $testroot/repo-clone/got.conf $testroot/got.conf.expected
571 ret="$?"
572 if [ "$ret" != "0" ]; then
573 diff -u $testroot/got.conf.expected \
574 $testroot/repo-clone/got.conf
575 test_done "$testroot" "$ret"
576 return 1
577 fi
579 cat > $testroot/config.expected <<EOF
580 [core]
581 repositoryformatversion = 0
582 filemode = true
583 bare = true
585 [remote "origin"]
586 url = ssh://127.0.0.1$testroot/repo
587 fetch = +refs/heads/foo:refs/remotes/origin/foo
588 EOF
589 cmp -s $testroot/repo-clone/config $testroot/config.expected
590 ret="$?"
591 if [ "$ret" != "0" ]; then
592 diff -u $testroot/config.expected \
593 $testroot/repo-clone/config
594 fi
595 test_done "$testroot" "$ret"
598 test_clone_reference_mirror() {
599 local testroot=`test_init clone_reference_mirror`
600 local testurl=ssh://127.0.0.1/$testroot
601 local commit_id=`git_show_head $testroot/repo`
603 got branch -r $testroot/repo -c $commit_id foo
604 got ref -r $testroot/repo -c $commit_id refs/hoo/boo/zoo
605 got tag -r $testroot/repo -c $commit_id -m tag "1.0" >/dev/null
606 local tag_id=`got ref -r $testroot/repo -l \
607 | grep "^refs/tags/$tag" | tr -d ' ' | cut -d: -f2`
609 got clone -q -R hoo -m $testurl/repo $testroot/repo-clone
610 ret="$?"
611 if [ "$ret" != "0" ]; then
612 echo "got clone command failed unexpectedly" >&2
613 test_done "$testroot" "$ret"
614 return 1
615 fi
617 got ref -l -r $testroot/repo-clone > $testroot/stdout
619 echo "HEAD: refs/heads/master" > $testroot/stdout.expected
620 echo "refs/heads/master: $commit_id" >> $testroot/stdout.expected
621 echo "refs/hoo/boo/zoo: $commit_id" >> $testroot/stdout.expected
622 echo "refs/tags/1.0: $tag_id" >> $testroot/stdout.expected
624 cmp -s $testroot/stdout $testroot/stdout.expected
625 ret="$?"
626 if [ "$ret" != "0" ]; then
627 diff -u $testroot/stdout.expected $testroot/stdout
628 test_done "$testroot" "$ret"
629 return 1
630 fi
632 cat > $testroot/got.conf.expected <<EOF
633 remote "origin" {
634 server 127.0.0.1
635 protocol ssh
636 repository "$testroot/repo"
637 branch { "master" }
638 mirror-references yes
640 EOF
641 cmp -s $testroot/repo-clone/got.conf $testroot/got.conf.expected
642 ret="$?"
643 if [ "$ret" != "0" ]; then
644 diff -u $testroot/got.conf.expected \
645 $testroot/repo-clone/got.conf
646 test_done "$testroot" "$ret"
647 return 1
648 fi
650 cat > $testroot/config.expected <<EOF
651 [core]
652 repositoryformatversion = 0
653 filemode = true
654 bare = true
656 [remote "origin"]
657 url = ssh://127.0.0.1$testroot/repo
658 fetch = +refs/*:refs/*
659 mirror = true
660 EOF
661 cmp -s $testroot/repo-clone/config $testroot/config.expected
662 ret="$?"
663 if [ "$ret" != "0" ]; then
664 diff -u $testroot/config.expected \
665 $testroot/repo-clone/config
666 fi
667 test_done "$testroot" "$ret"
670 test_parseargs "$@"
671 run_test test_clone_basic
672 run_test test_clone_list
673 run_test test_clone_branch
674 run_test test_clone_all
675 run_test test_clone_mirror
676 run_test test_clone_mirror_all
677 run_test test_clone_reference
678 run_test test_clone_branch_and_reference
679 run_test test_clone_reference_mirror