3 c8c71e6e 2020-03-21 stsp # Copyright (c) 2020 Stefan Sperling <stsp@openbsd.org>
5 c8c71e6e 2020-03-21 stsp # Permission to use, copy, modify, and distribute this software for any
6 c8c71e6e 2020-03-21 stsp # purpose with or without fee is hereby granted, provided that the above
7 c8c71e6e 2020-03-21 stsp # copyright notice and this permission notice appear in all copies.
9 c8c71e6e 2020-03-21 stsp # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 c8c71e6e 2020-03-21 stsp # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 c8c71e6e 2020-03-21 stsp # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 c8c71e6e 2020-03-21 stsp # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 c8c71e6e 2020-03-21 stsp # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 c8c71e6e 2020-03-21 stsp # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 c8c71e6e 2020-03-21 stsp # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 c8c71e6e 2020-03-21 stsp . ./common.sh
19 f6cae3ed 2020-09-13 naddy test_clone_basic() {
20 c8c71e6e 2020-03-21 stsp local testroot=`test_init clone_basic`
21 c8c71e6e 2020-03-21 stsp local testurl=ssh://127.0.0.1/$testroot
22 c8c71e6e 2020-03-21 stsp local commit_id=`git_show_head $testroot/repo`
24 c8c71e6e 2020-03-21 stsp got clone -q $testurl/repo $testroot/repo-clone
26 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
27 c8c71e6e 2020-03-21 stsp echo "got clone command failed unexpectedly" >&2
28 c8c71e6e 2020-03-21 stsp test_done "$testroot" "$ret"
32 c8c71e6e 2020-03-21 stsp got log -l0 -p -r $testroot/repo > $testroot/log-repo
34 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
35 c8c71e6e 2020-03-21 stsp echo "got log command failed unexpectedly" >&2
36 c8c71e6e 2020-03-21 stsp test_done "$testroot" "$ret"
39 6f59b577 2023-03-10 thomas got log -l0 -p -r $testroot/repo-clone | \
40 6f59b577 2023-03-10 thomas sed 's@master, origin/master@master@g' \
41 6f59b577 2023-03-10 thomas > $testroot/log-repo-clone
43 c8c71e6e 2020-03-21 stsp cmp -s $testroot/log-repo $testroot/log-repo-clone
45 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
46 c8c71e6e 2020-03-21 stsp echo "log -p output of cloned repository differs" >&2
47 c8c71e6e 2020-03-21 stsp test_done "$testroot" "$ret"
51 c8c71e6e 2020-03-21 stsp got ref -l -r $testroot/repo > $testroot/stdout
53 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
54 c8c71e6e 2020-03-21 stsp echo "got ref command failed unexpectedly" >&2
55 c8c71e6e 2020-03-21 stsp test_done "$testroot" "$ret"
59 c8c71e6e 2020-03-21 stsp echo "HEAD: refs/heads/master" > $testroot/stdout.expected
60 c8c71e6e 2020-03-21 stsp echo "refs/heads/master: $commit_id" >> $testroot/stdout.expected
62 c8c71e6e 2020-03-21 stsp cmp -s $testroot/stdout $testroot/stdout.expected
64 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
65 c8c71e6e 2020-03-21 stsp diff -u $testroot/stdout.expected $testroot/stdout
66 c8c71e6e 2020-03-21 stsp test_done "$testroot" "$ret"
70 c8c71e6e 2020-03-21 stsp got ref -l -r $testroot/repo-clone > $testroot/stdout
72 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
73 c8c71e6e 2020-03-21 stsp echo "got ref command failed unexpectedly" >&2
74 c8c71e6e 2020-03-21 stsp test_done "$testroot" "$ret"
78 c8c71e6e 2020-03-21 stsp echo "HEAD: refs/heads/master" > $testroot/stdout.expected
79 c8c71e6e 2020-03-21 stsp echo "refs/heads/master: $commit_id" >> $testroot/stdout.expected
80 f298ae0f 2020-03-25 stsp echo "refs/remotes/origin/HEAD: refs/remotes/origin/master" \
81 f298ae0f 2020-03-25 stsp >> $testroot/stdout.expected
82 c8c71e6e 2020-03-21 stsp echo "refs/remotes/origin/master: $commit_id" \
83 c8c71e6e 2020-03-21 stsp >> $testroot/stdout.expected
85 c8c71e6e 2020-03-21 stsp cmp -s $testroot/stdout $testroot/stdout.expected
87 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
88 c8c71e6e 2020-03-21 stsp diff -u $testroot/stdout.expected $testroot/stdout
89 a9c2d4c2 2020-09-24 stsp test_done "$testroot" "$ret"
93 a9c2d4c2 2020-09-24 stsp cat > $testroot/got.conf.expected <<EOF
94 a9c2d4c2 2020-09-24 stsp remote "origin" {
95 a9c2d4c2 2020-09-24 stsp server 127.0.0.1
96 a9c2d4c2 2020-09-24 stsp protocol ssh
97 a9c2d4c2 2020-09-24 stsp repository "$testroot/repo"
98 15d3c221 2021-01-05 stsp branch { "master" }
101 a9c2d4c2 2020-09-24 stsp cmp -s $testroot/repo-clone/got.conf $testroot/got.conf.expected
103 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
104 a9c2d4c2 2020-09-24 stsp diff -u $testroot/got.conf.expected \
105 a9c2d4c2 2020-09-24 stsp $testroot/repo-clone/got.conf
106 a9c2d4c2 2020-09-24 stsp test_done "$testroot" "$ret"
110 a9c2d4c2 2020-09-24 stsp cat > $testroot/config.expected <<EOF
112 a9c2d4c2 2020-09-24 stsp repositoryformatversion = 0
113 a9c2d4c2 2020-09-24 stsp filemode = true
114 a9c2d4c2 2020-09-24 stsp bare = true
116 a9c2d4c2 2020-09-24 stsp [remote "origin"]
117 a9c2d4c2 2020-09-24 stsp url = ssh://127.0.0.1$testroot/repo
118 56d0a753 2021-01-20 stsp fetch = refs/heads/master:refs/remotes/origin/master
119 56d0a753 2021-01-20 stsp fetch = refs/tags/*:refs/tags/*
121 a9c2d4c2 2020-09-24 stsp cmp -s $testroot/repo-clone/config $testroot/config.expected
123 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
124 a9c2d4c2 2020-09-24 stsp diff -u $testroot/config.expected \
125 a9c2d4c2 2020-09-24 stsp $testroot/repo-clone/config
127 c8c71e6e 2020-03-21 stsp test_done "$testroot" "$ret"
130 f6cae3ed 2020-09-13 naddy test_clone_list() {
131 c8c71e6e 2020-03-21 stsp local testroot=`test_init clone_list`
132 6df5d941 2022-11-18 thomas local testurl=ssh://127.0.0.1$testroot
133 c8c71e6e 2020-03-21 stsp local commit_id=`git_show_head $testroot/repo`
135 c8c71e6e 2020-03-21 stsp got branch -r $testroot/repo -c $commit_id foo
136 e31abbf2 2020-03-22 stsp got ref -r $testroot/repo -c $commit_id refs/hoo/boo/zoo
137 c8c71e6e 2020-03-21 stsp got tag -r $testroot/repo -c $commit_id -m tag "1.0" >/dev/null
139 c8c71e6e 2020-03-21 stsp got clone -l $testurl/repo > $testroot/stdout 2>$testroot/stderr
141 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
142 c8c71e6e 2020-03-21 stsp echo "got clone command failed unexpectedly" >&2
143 c8c71e6e 2020-03-21 stsp test_done "$testroot" "$ret"
147 6df5d941 2022-11-18 thomas echo "Connecting to $testurl/repo" > $testroot/stdout.expected
148 c8c71e6e 2020-03-21 stsp got ref -l -r $testroot/repo >> $testroot/stdout.expected
150 c8c71e6e 2020-03-21 stsp cmp -s $testroot/stdout $testroot/stdout.expected
152 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
153 c8c71e6e 2020-03-21 stsp diff -u $testroot/stdout.expected $testroot/stdout
155 c8c71e6e 2020-03-21 stsp test_done "$testroot" "$ret"
158 f6cae3ed 2020-09-13 naddy test_clone_branch() {
159 c8c71e6e 2020-03-21 stsp local testroot=`test_init clone_branch`
160 c8c71e6e 2020-03-21 stsp local testurl=ssh://127.0.0.1/$testroot
161 c8c71e6e 2020-03-21 stsp local commit_id=`git_show_head $testroot/repo`
163 c8c71e6e 2020-03-21 stsp got branch -r $testroot/repo -c $commit_id foo
164 e31abbf2 2020-03-22 stsp got ref -r $testroot/repo -c $commit_id refs/hoo/boo/zoo
165 c8c71e6e 2020-03-21 stsp got tag -r $testroot/repo -c $commit_id -m tag "1.0" >/dev/null
166 c8c71e6e 2020-03-21 stsp local tag_id=`got ref -r $testroot/repo -l \
167 c8c71e6e 2020-03-21 stsp | grep "^refs/tags/$tag" | tr -d ' ' | cut -d: -f2`
169 c8c71e6e 2020-03-21 stsp got clone -q -b foo $testurl/repo $testroot/repo-clone
171 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
172 c8c71e6e 2020-03-21 stsp echo "got clone command failed unexpectedly" >&2
173 c8c71e6e 2020-03-21 stsp test_done "$testroot" "$ret"
177 c8c71e6e 2020-03-21 stsp got ref -l -r $testroot/repo-clone > $testroot/stdout
179 c8c71e6e 2020-03-21 stsp echo "HEAD: refs/heads/foo" > $testroot/stdout.expected
180 c8c71e6e 2020-03-21 stsp echo "refs/heads/foo: $commit_id" >> $testroot/stdout.expected
181 c8c71e6e 2020-03-21 stsp # refs/heads/master is missing because it wasn't passed via -b
182 c8c71e6e 2020-03-21 stsp echo "refs/remotes/origin/foo: $commit_id" >> $testroot/stdout.expected
183 c8c71e6e 2020-03-21 stsp # refs/hoo/boo/zoo is missing because it is outside of refs/heads
184 c8c71e6e 2020-03-21 stsp echo "refs/tags/1.0: $tag_id" >> $testroot/stdout.expected
186 c8c71e6e 2020-03-21 stsp cmp -s $testroot/stdout $testroot/stdout.expected
188 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
189 c8c71e6e 2020-03-21 stsp diff -u $testroot/stdout.expected $testroot/stdout
190 a9c2d4c2 2020-09-24 stsp test_done "$testroot" "$ret"
194 a9c2d4c2 2020-09-24 stsp cat > $testroot/got.conf.expected <<EOF
195 a9c2d4c2 2020-09-24 stsp remote "origin" {
196 a9c2d4c2 2020-09-24 stsp server 127.0.0.1
197 a9c2d4c2 2020-09-24 stsp protocol ssh
198 a9c2d4c2 2020-09-24 stsp repository "$testroot/repo"
199 15d3c221 2021-01-05 stsp branch { "foo" }
202 a9c2d4c2 2020-09-24 stsp cmp -s $testroot/repo-clone/got.conf $testroot/got.conf.expected
204 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
205 a9c2d4c2 2020-09-24 stsp diff -u $testroot/got.conf.expected \
206 a9c2d4c2 2020-09-24 stsp $testroot/repo-clone/got.conf
207 a9c2d4c2 2020-09-24 stsp test_done "$testroot" "$ret"
211 a9c2d4c2 2020-09-24 stsp cat > $testroot/config.expected <<EOF
213 a9c2d4c2 2020-09-24 stsp repositoryformatversion = 0
214 a9c2d4c2 2020-09-24 stsp filemode = true
215 a9c2d4c2 2020-09-24 stsp bare = true
217 a9c2d4c2 2020-09-24 stsp [remote "origin"]
218 a9c2d4c2 2020-09-24 stsp url = ssh://127.0.0.1$testroot/repo
219 56d0a753 2021-01-20 stsp fetch = refs/heads/foo:refs/remotes/origin/foo
220 56d0a753 2021-01-20 stsp fetch = refs/tags/*:refs/tags/*
222 a9c2d4c2 2020-09-24 stsp cmp -s $testroot/repo-clone/config $testroot/config.expected
224 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
225 a9c2d4c2 2020-09-24 stsp diff -u $testroot/config.expected \
226 a9c2d4c2 2020-09-24 stsp $testroot/repo-clone/config
228 c8c71e6e 2020-03-21 stsp test_done "$testroot" "$ret"
231 f6cae3ed 2020-09-13 naddy test_clone_all() {
232 c8c71e6e 2020-03-21 stsp local testroot=`test_init clone_all`
233 c8c71e6e 2020-03-21 stsp local testurl=ssh://127.0.0.1/$testroot
234 c8c71e6e 2020-03-21 stsp local commit_id=`git_show_head $testroot/repo`
236 c8c71e6e 2020-03-21 stsp got branch -r $testroot/repo -c $commit_id foo
237 e31abbf2 2020-03-22 stsp got ref -r $testroot/repo -c $commit_id refs/hoo/boo/zoo
238 c8c71e6e 2020-03-21 stsp got tag -r $testroot/repo -c $commit_id -m tag "1.0" >/dev/null
239 c8c71e6e 2020-03-21 stsp local tag_id=`got ref -r $testroot/repo -l \
240 c8c71e6e 2020-03-21 stsp | grep "^refs/tags/$tag" | tr -d ' ' | cut -d: -f2`
242 c8c71e6e 2020-03-21 stsp got clone -q -a $testurl/repo $testroot/repo-clone
244 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
245 c8c71e6e 2020-03-21 stsp echo "got clone command failed unexpectedly" >&2
246 c8c71e6e 2020-03-21 stsp test_done "$testroot" "$ret"
250 c8c71e6e 2020-03-21 stsp got ref -l -r $testroot/repo-clone > $testroot/stdout
252 c8c71e6e 2020-03-21 stsp echo "HEAD: refs/heads/master" > $testroot/stdout.expected
253 c8c71e6e 2020-03-21 stsp echo "refs/heads/foo: $commit_id" >> $testroot/stdout.expected
254 c8c71e6e 2020-03-21 stsp echo "refs/heads/master: $commit_id" >> $testroot/stdout.expected
255 f298ae0f 2020-03-25 stsp echo "refs/remotes/origin/HEAD: refs/remotes/origin/master" \
256 f298ae0f 2020-03-25 stsp >> $testroot/stdout.expected
257 c8c71e6e 2020-03-21 stsp echo "refs/remotes/origin/foo: $commit_id" >> $testroot/stdout.expected
258 c8c71e6e 2020-03-21 stsp echo "refs/remotes/origin/master: $commit_id" \
259 c8c71e6e 2020-03-21 stsp >> $testroot/stdout.expected
260 c8c71e6e 2020-03-21 stsp # refs/hoo/boo/zoo is missing because it is outside of refs/heads
261 c8c71e6e 2020-03-21 stsp echo "refs/tags/1.0: $tag_id" >> $testroot/stdout.expected
263 c8c71e6e 2020-03-21 stsp cmp -s $testroot/stdout $testroot/stdout.expected
265 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
266 c8c71e6e 2020-03-21 stsp diff -u $testroot/stdout.expected $testroot/stdout
267 a9c2d4c2 2020-09-24 stsp test_done "$testroot" "$ret"
271 a9c2d4c2 2020-09-24 stsp cat > $testroot/got.conf.expected <<EOF
272 a9c2d4c2 2020-09-24 stsp remote "origin" {
273 a9c2d4c2 2020-09-24 stsp server 127.0.0.1
274 a9c2d4c2 2020-09-24 stsp protocol ssh
275 a9c2d4c2 2020-09-24 stsp repository "$testroot/repo"
276 25eb5847 2022-07-03 thomas fetch_all_branches yes
279 a9c2d4c2 2020-09-24 stsp cmp -s $testroot/repo-clone/got.conf $testroot/got.conf.expected
281 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
282 a9c2d4c2 2020-09-24 stsp diff -u $testroot/got.conf.expected \
283 a9c2d4c2 2020-09-24 stsp $testroot/repo-clone/got.conf
284 a9c2d4c2 2020-09-24 stsp test_done "$testroot" "$ret"
288 a9c2d4c2 2020-09-24 stsp cat > $testroot/config.expected <<EOF
290 a9c2d4c2 2020-09-24 stsp repositoryformatversion = 0
291 a9c2d4c2 2020-09-24 stsp filemode = true
292 a9c2d4c2 2020-09-24 stsp bare = true
294 a9c2d4c2 2020-09-24 stsp [remote "origin"]
295 a9c2d4c2 2020-09-24 stsp url = ssh://127.0.0.1$testroot/repo
296 56d0a753 2021-01-20 stsp fetch = refs/heads/*:refs/remotes/origin/*
297 56d0a753 2021-01-20 stsp fetch = refs/tags/*:refs/tags/*
299 a9c2d4c2 2020-09-24 stsp cmp -s $testroot/repo-clone/config $testroot/config.expected
301 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
302 a9c2d4c2 2020-09-24 stsp diff -u $testroot/config.expected \
303 a9c2d4c2 2020-09-24 stsp $testroot/repo-clone/config
305 c8c71e6e 2020-03-21 stsp test_done "$testroot" "$ret"
308 f6cae3ed 2020-09-13 naddy test_clone_mirror() {
309 c8c71e6e 2020-03-21 stsp local testroot=`test_init clone_mirror`
310 c8c71e6e 2020-03-21 stsp local testurl=ssh://127.0.0.1/$testroot
311 c8c71e6e 2020-03-21 stsp local commit_id=`git_show_head $testroot/repo`
313 c8c71e6e 2020-03-21 stsp got branch -r $testroot/repo -c $commit_id foo
314 e31abbf2 2020-03-22 stsp got ref -r $testroot/repo -c $commit_id refs/hoo/boo/zoo
315 c8c71e6e 2020-03-21 stsp got tag -r $testroot/repo -c $commit_id -m tag "1.0" >/dev/null
316 c8c71e6e 2020-03-21 stsp local tag_id=`got ref -r $testroot/repo -l \
317 c8c71e6e 2020-03-21 stsp | grep "^refs/tags/$tag" | tr -d ' ' | cut -d: -f2`
319 c8c71e6e 2020-03-21 stsp got clone -q -m $testurl/repo $testroot/repo-clone
321 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
322 c8c71e6e 2020-03-21 stsp echo "got clone command failed unexpectedly" >&2
323 c8c71e6e 2020-03-21 stsp test_done "$testroot" "$ret"
327 c8c71e6e 2020-03-21 stsp got ref -l -r $testroot/repo-clone > $testroot/stdout
329 c8c71e6e 2020-03-21 stsp echo "HEAD: refs/heads/master" > $testroot/stdout.expected
330 c8c71e6e 2020-03-21 stsp # refs/heads/foo is missing because we're not fetching all branches
331 c8c71e6e 2020-03-21 stsp echo "refs/heads/master: $commit_id" >> $testroot/stdout.expected
332 c8c71e6e 2020-03-21 stsp # refs/hoo/boo/zoo is missing because it is outside of refs/heads
333 c8c71e6e 2020-03-21 stsp echo "refs/tags/1.0: $tag_id" >> $testroot/stdout.expected
335 c8c71e6e 2020-03-21 stsp cmp -s $testroot/stdout $testroot/stdout.expected
337 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
338 c8c71e6e 2020-03-21 stsp diff -u $testroot/stdout.expected $testroot/stdout
339 a9c2d4c2 2020-09-24 stsp test_done "$testroot" "$ret"
343 a9c2d4c2 2020-09-24 stsp cat > $testroot/got.conf.expected <<EOF
344 a9c2d4c2 2020-09-24 stsp remote "origin" {
345 a9c2d4c2 2020-09-24 stsp server 127.0.0.1
346 a9c2d4c2 2020-09-24 stsp protocol ssh
347 a9c2d4c2 2020-09-24 stsp repository "$testroot/repo"
348 15d3c221 2021-01-05 stsp branch { "master" }
349 459c9b5d 2022-07-03 thomas mirror_references yes
352 a9c2d4c2 2020-09-24 stsp cmp -s $testroot/repo-clone/got.conf $testroot/got.conf.expected
354 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
355 a9c2d4c2 2020-09-24 stsp diff -u $testroot/got.conf.expected \
356 a9c2d4c2 2020-09-24 stsp $testroot/repo-clone/got.conf
357 a9c2d4c2 2020-09-24 stsp test_done "$testroot" "$ret"
361 a9c2d4c2 2020-09-24 stsp cat > $testroot/config.expected <<EOF
363 a9c2d4c2 2020-09-24 stsp repositoryformatversion = 0
364 a9c2d4c2 2020-09-24 stsp filemode = true
365 a9c2d4c2 2020-09-24 stsp bare = true
367 a9c2d4c2 2020-09-24 stsp [remote "origin"]
368 a9c2d4c2 2020-09-24 stsp url = ssh://127.0.0.1$testroot/repo
369 56d0a753 2021-01-20 stsp fetch = refs/heads/master:refs/heads/master
370 56d0a753 2021-01-20 stsp fetch = refs/tags/*:refs/tags/*
372 a9c2d4c2 2020-09-24 stsp cmp -s $testroot/repo-clone/config $testroot/config.expected
374 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
375 a9c2d4c2 2020-09-24 stsp diff -u $testroot/config.expected \
376 a9c2d4c2 2020-09-24 stsp $testroot/repo-clone/config
378 c8c71e6e 2020-03-21 stsp test_done "$testroot" "$ret"
381 f6cae3ed 2020-09-13 naddy test_clone_mirror_all() {
382 c8c71e6e 2020-03-21 stsp local testroot=`test_init clone_mirror_all`
383 c8c71e6e 2020-03-21 stsp local testurl=ssh://127.0.0.1/$testroot
384 c8c71e6e 2020-03-21 stsp local commit_id=`git_show_head $testroot/repo`
386 c8c71e6e 2020-03-21 stsp got branch -r $testroot/repo -c $commit_id foo
387 e31abbf2 2020-03-22 stsp got ref -r $testroot/repo -c $commit_id refs/hoo/boo/zoo
388 c8c71e6e 2020-03-21 stsp got tag -r $testroot/repo -c $commit_id -m tag "1.0" >/dev/null
389 c8c71e6e 2020-03-21 stsp local tag_id=`got ref -r $testroot/repo -l \
390 c8c71e6e 2020-03-21 stsp | grep "^refs/tags/$tag" | tr -d ' ' | cut -d: -f2`
392 c8c71e6e 2020-03-21 stsp got clone -q -m -a $testurl/repo $testroot/repo-clone
394 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
395 c8c71e6e 2020-03-21 stsp echo "got clone command failed unexpectedly" >&2
396 c8c71e6e 2020-03-21 stsp test_done "$testroot" "$ret"
400 c8c71e6e 2020-03-21 stsp got ref -l -r $testroot/repo-clone > $testroot/stdout
402 c8c71e6e 2020-03-21 stsp echo "HEAD: refs/heads/master" > $testroot/stdout.expected
403 c8c71e6e 2020-03-21 stsp echo "refs/heads/foo: $commit_id" >> $testroot/stdout.expected
404 c8c71e6e 2020-03-21 stsp echo "refs/heads/master: $commit_id" >> $testroot/stdout.expected
405 c8c71e6e 2020-03-21 stsp # refs/hoo/boo/zoo is missing because it is outside of refs/heads
406 c8c71e6e 2020-03-21 stsp echo "refs/tags/1.0: $tag_id" >> $testroot/stdout.expected
408 c8c71e6e 2020-03-21 stsp cmp -s $testroot/stdout $testroot/stdout.expected
410 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
411 c8c71e6e 2020-03-21 stsp diff -u $testroot/stdout.expected $testroot/stdout
412 a9c2d4c2 2020-09-24 stsp test_done "$testroot" "$ret"
416 a9c2d4c2 2020-09-24 stsp cat > $testroot/got.conf.expected <<EOF
417 a9c2d4c2 2020-09-24 stsp remote "origin" {
418 a9c2d4c2 2020-09-24 stsp server 127.0.0.1
419 a9c2d4c2 2020-09-24 stsp protocol ssh
420 a9c2d4c2 2020-09-24 stsp repository "$testroot/repo"
421 459c9b5d 2022-07-03 thomas mirror_references yes
422 25eb5847 2022-07-03 thomas fetch_all_branches yes
425 a9c2d4c2 2020-09-24 stsp cmp -s $testroot/repo-clone/got.conf $testroot/got.conf.expected
427 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
428 a9c2d4c2 2020-09-24 stsp diff -u $testroot/got.conf.expected \
429 a9c2d4c2 2020-09-24 stsp $testroot/repo-clone/got.conf
430 a9c2d4c2 2020-09-24 stsp test_done "$testroot" "$ret"
434 a9c2d4c2 2020-09-24 stsp cat > $testroot/config.expected <<EOF
436 a9c2d4c2 2020-09-24 stsp repositoryformatversion = 0
437 a9c2d4c2 2020-09-24 stsp filemode = true
438 a9c2d4c2 2020-09-24 stsp bare = true
440 a9c2d4c2 2020-09-24 stsp [remote "origin"]
441 a9c2d4c2 2020-09-24 stsp url = ssh://127.0.0.1$testroot/repo
442 56d0a753 2021-01-20 stsp fetch = refs/heads/*:refs/heads/*
443 56d0a753 2021-01-20 stsp fetch = refs/tags/*:refs/tags/*
445 a9c2d4c2 2020-09-24 stsp cmp -s $testroot/repo-clone/config $testroot/config.expected
447 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
448 a9c2d4c2 2020-09-24 stsp diff -u $testroot/config.expected \
449 a9c2d4c2 2020-09-24 stsp $testroot/repo-clone/config
451 c8c71e6e 2020-03-21 stsp test_done "$testroot" "$ret"
454 f6cae3ed 2020-09-13 naddy test_clone_reference() {
455 0e4002ca 2020-03-21 stsp local testroot=`test_init clone_reference`
456 0e4002ca 2020-03-21 stsp local testurl=ssh://127.0.0.1/$testroot
457 0e4002ca 2020-03-21 stsp local commit_id=`git_show_head $testroot/repo`
459 0e4002ca 2020-03-21 stsp got branch -r $testroot/repo -c $commit_id foo
460 e31abbf2 2020-03-22 stsp got ref -r $testroot/repo -c $commit_id refs/hoo/boo/zoo
461 0e4002ca 2020-03-21 stsp got tag -r $testroot/repo -c $commit_id -m tag "1.0" >/dev/null
462 0e4002ca 2020-03-21 stsp local tag_id=`got ref -r $testroot/repo -l \
463 0e4002ca 2020-03-21 stsp | grep "^refs/tags/$tag" | tr -d ' ' | cut -d: -f2`
465 0e4002ca 2020-03-21 stsp got clone -q -R hoo $testurl/repo $testroot/repo-clone
467 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
468 0e4002ca 2020-03-21 stsp echo "got clone command failed unexpectedly" >&2
469 0e4002ca 2020-03-21 stsp test_done "$testroot" "$ret"
473 0e4002ca 2020-03-21 stsp got ref -l -r $testroot/repo-clone > $testroot/stdout
475 0e4002ca 2020-03-21 stsp echo "HEAD: refs/heads/master" > $testroot/stdout.expected
476 0e4002ca 2020-03-21 stsp echo "refs/heads/master: $commit_id" >> $testroot/stdout.expected
477 f298ae0f 2020-03-25 stsp echo "refs/remotes/origin/HEAD: refs/remotes/origin/master" \
478 f298ae0f 2020-03-25 stsp >> $testroot/stdout.expected
479 0e4002ca 2020-03-21 stsp echo "refs/remotes/origin/hoo/boo/zoo: $commit_id" \
480 0e4002ca 2020-03-21 stsp >> $testroot/stdout.expected
481 0e4002ca 2020-03-21 stsp echo "refs/remotes/origin/master: $commit_id" \
482 0e4002ca 2020-03-21 stsp >> $testroot/stdout.expected
483 0e4002ca 2020-03-21 stsp echo "refs/tags/1.0: $tag_id" >> $testroot/stdout.expected
485 0e4002ca 2020-03-21 stsp cmp -s $testroot/stdout $testroot/stdout.expected
487 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
488 0e4002ca 2020-03-21 stsp diff -u $testroot/stdout.expected $testroot/stdout
489 a9c2d4c2 2020-09-24 stsp test_done "$testroot" "$ret"
493 a9c2d4c2 2020-09-24 stsp cat > $testroot/got.conf.expected <<EOF
494 a9c2d4c2 2020-09-24 stsp remote "origin" {
495 a9c2d4c2 2020-09-24 stsp server 127.0.0.1
496 a9c2d4c2 2020-09-24 stsp protocol ssh
497 a9c2d4c2 2020-09-24 stsp repository "$testroot/repo"
498 15d3c221 2021-01-05 stsp branch { "master" }
499 99495ddb 2021-01-10 stsp reference { "hoo" }
502 a9c2d4c2 2020-09-24 stsp cmp -s $testroot/repo-clone/got.conf $testroot/got.conf.expected
504 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
505 a9c2d4c2 2020-09-24 stsp diff -u $testroot/got.conf.expected \
506 a9c2d4c2 2020-09-24 stsp $testroot/repo-clone/got.conf
507 a9c2d4c2 2020-09-24 stsp test_done "$testroot" "$ret"
511 a9c2d4c2 2020-09-24 stsp cat > $testroot/config.expected <<EOF
513 a9c2d4c2 2020-09-24 stsp repositoryformatversion = 0
514 a9c2d4c2 2020-09-24 stsp filemode = true
515 a9c2d4c2 2020-09-24 stsp bare = true
517 a9c2d4c2 2020-09-24 stsp [remote "origin"]
518 a9c2d4c2 2020-09-24 stsp url = ssh://127.0.0.1$testroot/repo
519 56d0a753 2021-01-20 stsp fetch = refs/heads/master:refs/remotes/origin/master
520 56d0a753 2021-01-20 stsp fetch = refs/hoo:refs/remotes/origin/hoo
521 56d0a753 2021-01-20 stsp fetch = refs/tags/*:refs/tags/*
523 a9c2d4c2 2020-09-24 stsp cmp -s $testroot/repo-clone/config $testroot/config.expected
525 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
526 a9c2d4c2 2020-09-24 stsp diff -u $testroot/config.expected \
527 a9c2d4c2 2020-09-24 stsp $testroot/repo-clone/config
529 0e4002ca 2020-03-21 stsp test_done "$testroot" "$ret"
532 f6cae3ed 2020-09-13 naddy test_clone_branch_and_reference() {
533 0e4002ca 2020-03-21 stsp local testroot=`test_init clone_reference`
534 0e4002ca 2020-03-21 stsp local testurl=ssh://127.0.0.1/$testroot
535 0e4002ca 2020-03-21 stsp local commit_id=`git_show_head $testroot/repo`
537 0e4002ca 2020-03-21 stsp got branch -r $testroot/repo -c $commit_id foo
538 e31abbf2 2020-03-22 stsp got ref -r $testroot/repo -c $commit_id refs/hoo/boo/zoo
539 0e4002ca 2020-03-21 stsp got tag -r $testroot/repo -c $commit_id -m tag "1.0" >/dev/null
540 0e4002ca 2020-03-21 stsp local tag_id=`got ref -r $testroot/repo -l \
541 0e4002ca 2020-03-21 stsp | grep "^refs/tags/$tag" | tr -d ' ' | cut -d: -f2`
543 0e4002ca 2020-03-21 stsp got clone -q -R hoo/boo/zoo -b foo $testurl/repo $testroot/repo-clone
545 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
546 0e4002ca 2020-03-21 stsp echo "got clone command failed unexpectedly" >&2
547 0e4002ca 2020-03-21 stsp test_done "$testroot" "$ret"
551 0e4002ca 2020-03-21 stsp got ref -l -r $testroot/repo-clone > $testroot/stdout
553 0e4002ca 2020-03-21 stsp echo "HEAD: refs/heads/foo" > $testroot/stdout.expected
554 0e4002ca 2020-03-21 stsp echo "refs/heads/foo: $commit_id" >> $testroot/stdout.expected
555 0e4002ca 2020-03-21 stsp echo "refs/remotes/origin/foo: $commit_id" \
556 0e4002ca 2020-03-21 stsp >> $testroot/stdout.expected
557 0e4002ca 2020-03-21 stsp echo "refs/remotes/origin/hoo/boo/zoo: $commit_id" \
558 0e4002ca 2020-03-21 stsp >> $testroot/stdout.expected
559 0e4002ca 2020-03-21 stsp echo "refs/tags/1.0: $tag_id" >> $testroot/stdout.expected
561 0e4002ca 2020-03-21 stsp cmp -s $testroot/stdout $testroot/stdout.expected
563 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
564 0e4002ca 2020-03-21 stsp diff -u $testroot/stdout.expected $testroot/stdout
565 a9c2d4c2 2020-09-24 stsp test_done "$testroot" "$ret"
569 a9c2d4c2 2020-09-24 stsp cat > $testroot/got.conf.expected <<EOF
570 a9c2d4c2 2020-09-24 stsp remote "origin" {
571 a9c2d4c2 2020-09-24 stsp server 127.0.0.1
572 a9c2d4c2 2020-09-24 stsp protocol ssh
573 a9c2d4c2 2020-09-24 stsp repository "$testroot/repo"
574 15d3c221 2021-01-05 stsp branch { "foo" }
575 99495ddb 2021-01-10 stsp reference { "hoo/boo/zoo" }
578 a9c2d4c2 2020-09-24 stsp cmp -s $testroot/repo-clone/got.conf $testroot/got.conf.expected
580 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
581 a9c2d4c2 2020-09-24 stsp diff -u $testroot/got.conf.expected \
582 a9c2d4c2 2020-09-24 stsp $testroot/repo-clone/got.conf
583 a9c2d4c2 2020-09-24 stsp test_done "$testroot" "$ret"
587 a9c2d4c2 2020-09-24 stsp cat > $testroot/config.expected <<EOF
589 a9c2d4c2 2020-09-24 stsp repositoryformatversion = 0
590 a9c2d4c2 2020-09-24 stsp filemode = true
591 a9c2d4c2 2020-09-24 stsp bare = true
593 a9c2d4c2 2020-09-24 stsp [remote "origin"]
594 a9c2d4c2 2020-09-24 stsp url = ssh://127.0.0.1$testroot/repo
595 56d0a753 2021-01-20 stsp fetch = refs/heads/foo:refs/remotes/origin/foo
596 56d0a753 2021-01-20 stsp fetch = refs/hoo/boo/zoo:refs/remotes/origin/hoo/boo/zoo
597 56d0a753 2021-01-20 stsp fetch = refs/tags/*:refs/tags/*
599 a9c2d4c2 2020-09-24 stsp cmp -s $testroot/repo-clone/config $testroot/config.expected
601 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
602 a9c2d4c2 2020-09-24 stsp diff -u $testroot/config.expected \
603 a9c2d4c2 2020-09-24 stsp $testroot/repo-clone/config
605 0e4002ca 2020-03-21 stsp test_done "$testroot" "$ret"
608 f6cae3ed 2020-09-13 naddy test_clone_reference_mirror() {
609 0e4002ca 2020-03-21 stsp local testroot=`test_init clone_reference_mirror`
610 0e4002ca 2020-03-21 stsp local testurl=ssh://127.0.0.1/$testroot
611 0e4002ca 2020-03-21 stsp local commit_id=`git_show_head $testroot/repo`
613 0e4002ca 2020-03-21 stsp got branch -r $testroot/repo -c $commit_id foo
614 e31abbf2 2020-03-22 stsp got ref -r $testroot/repo -c $commit_id refs/hoo/boo/zoo
615 0e4002ca 2020-03-21 stsp got tag -r $testroot/repo -c $commit_id -m tag "1.0" >/dev/null
616 0e4002ca 2020-03-21 stsp local tag_id=`got ref -r $testroot/repo -l \
617 0e4002ca 2020-03-21 stsp | grep "^refs/tags/$tag" | tr -d ' ' | cut -d: -f2`
619 0e4002ca 2020-03-21 stsp got clone -q -R hoo -m $testurl/repo $testroot/repo-clone
621 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
622 0e4002ca 2020-03-21 stsp echo "got clone command failed unexpectedly" >&2
623 0e4002ca 2020-03-21 stsp test_done "$testroot" "$ret"
627 0e4002ca 2020-03-21 stsp got ref -l -r $testroot/repo-clone > $testroot/stdout
629 0e4002ca 2020-03-21 stsp echo "HEAD: refs/heads/master" > $testroot/stdout.expected
630 0e4002ca 2020-03-21 stsp echo "refs/heads/master: $commit_id" >> $testroot/stdout.expected
631 0e4002ca 2020-03-21 stsp echo "refs/hoo/boo/zoo: $commit_id" >> $testroot/stdout.expected
632 0e4002ca 2020-03-21 stsp echo "refs/tags/1.0: $tag_id" >> $testroot/stdout.expected
634 0e4002ca 2020-03-21 stsp cmp -s $testroot/stdout $testroot/stdout.expected
636 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
637 0e4002ca 2020-03-21 stsp diff -u $testroot/stdout.expected $testroot/stdout
638 a9c2d4c2 2020-09-24 stsp test_done "$testroot" "$ret"
642 a9c2d4c2 2020-09-24 stsp cat > $testroot/got.conf.expected <<EOF
643 a9c2d4c2 2020-09-24 stsp remote "origin" {
644 a9c2d4c2 2020-09-24 stsp server 127.0.0.1
645 a9c2d4c2 2020-09-24 stsp protocol ssh
646 a9c2d4c2 2020-09-24 stsp repository "$testroot/repo"
647 15d3c221 2021-01-05 stsp branch { "master" }
648 99495ddb 2021-01-10 stsp reference { "hoo" }
649 459c9b5d 2022-07-03 thomas mirror_references yes
652 a9c2d4c2 2020-09-24 stsp cmp -s $testroot/repo-clone/got.conf $testroot/got.conf.expected
654 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
655 a9c2d4c2 2020-09-24 stsp diff -u $testroot/got.conf.expected \
656 a9c2d4c2 2020-09-24 stsp $testroot/repo-clone/got.conf
657 a9c2d4c2 2020-09-24 stsp test_done "$testroot" "$ret"
661 a9c2d4c2 2020-09-24 stsp cat > $testroot/config.expected <<EOF
663 a9c2d4c2 2020-09-24 stsp repositoryformatversion = 0
664 a9c2d4c2 2020-09-24 stsp filemode = true
665 a9c2d4c2 2020-09-24 stsp bare = true
667 a9c2d4c2 2020-09-24 stsp [remote "origin"]
668 a9c2d4c2 2020-09-24 stsp url = ssh://127.0.0.1$testroot/repo
669 56d0a753 2021-01-20 stsp fetch = refs/heads/master:refs/heads/master
670 56d0a753 2021-01-20 stsp fetch = refs/hoo:refs/hoo
671 56d0a753 2021-01-20 stsp fetch = refs/tags/*:refs/tags/*
673 132af4a5 2021-01-05 stsp cmp -s $testroot/repo-clone/config $testroot/config.expected
675 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
676 132af4a5 2021-01-05 stsp diff -u $testroot/config.expected \
677 132af4a5 2021-01-05 stsp $testroot/repo-clone/config
679 132af4a5 2021-01-05 stsp test_done "$testroot" "$ret"
682 132af4a5 2021-01-05 stsp test_clone_multiple_branches() {
683 132af4a5 2021-01-05 stsp local testroot=`test_init clone_multiple_branches`
684 132af4a5 2021-01-05 stsp local testurl=ssh://127.0.0.1/$testroot
685 132af4a5 2021-01-05 stsp local commit_id=`git_show_head $testroot/repo`
687 132af4a5 2021-01-05 stsp got branch -r $testroot/repo -c $commit_id foo
688 132af4a5 2021-01-05 stsp got branch -r $testroot/repo -c $commit_id bar
690 132af4a5 2021-01-05 stsp got clone -q -b foo -b bar $testurl/repo $testroot/repo-clone
692 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
693 132af4a5 2021-01-05 stsp echo "got clone command failed unexpectedly" >&2
694 132af4a5 2021-01-05 stsp test_done "$testroot" "$ret"
698 132af4a5 2021-01-05 stsp got ref -l -r $testroot/repo-clone > $testroot/stdout
700 132af4a5 2021-01-05 stsp echo "HEAD: refs/heads/foo" > $testroot/stdout.expected
701 132af4a5 2021-01-05 stsp echo "refs/heads/bar: $commit_id" >> $testroot/stdout.expected
702 132af4a5 2021-01-05 stsp echo "refs/heads/foo: $commit_id" >> $testroot/stdout.expected
703 132af4a5 2021-01-05 stsp echo "refs/remotes/origin/bar: $commit_id" \
704 132af4a5 2021-01-05 stsp >> $testroot/stdout.expected
705 132af4a5 2021-01-05 stsp echo "refs/remotes/origin/foo: $commit_id" \
706 132af4a5 2021-01-05 stsp >> $testroot/stdout.expected
708 132af4a5 2021-01-05 stsp cmp -s $testroot/stdout $testroot/stdout.expected
710 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
711 132af4a5 2021-01-05 stsp diff -u $testroot/stdout.expected $testroot/stdout
712 132af4a5 2021-01-05 stsp test_done "$testroot" "$ret"
716 132af4a5 2021-01-05 stsp cat > $testroot/got.conf.expected <<EOF
717 132af4a5 2021-01-05 stsp remote "origin" {
718 132af4a5 2021-01-05 stsp server 127.0.0.1
719 132af4a5 2021-01-05 stsp protocol ssh
720 132af4a5 2021-01-05 stsp repository "$testroot/repo"
721 132af4a5 2021-01-05 stsp branch { "foo" "bar" }
724 132af4a5 2021-01-05 stsp cmp -s $testroot/repo-clone/got.conf $testroot/got.conf.expected
726 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
727 132af4a5 2021-01-05 stsp diff -u $testroot/got.conf.expected \
728 132af4a5 2021-01-05 stsp $testroot/repo-clone/got.conf
729 132af4a5 2021-01-05 stsp test_done "$testroot" "$ret"
733 132af4a5 2021-01-05 stsp cat > $testroot/config.expected <<EOF
735 132af4a5 2021-01-05 stsp repositoryformatversion = 0
736 132af4a5 2021-01-05 stsp filemode = true
737 132af4a5 2021-01-05 stsp bare = true
739 132af4a5 2021-01-05 stsp [remote "origin"]
740 132af4a5 2021-01-05 stsp url = ssh://127.0.0.1$testroot/repo
741 56d0a753 2021-01-20 stsp fetch = refs/heads/foo:refs/remotes/origin/foo
742 56d0a753 2021-01-20 stsp fetch = refs/heads/bar:refs/remotes/origin/bar
743 c22ed3f5 2022-11-08 thomas fetch = refs/tags/*:refs/tags/*
745 c22ed3f5 2022-11-08 thomas cmp -s $testroot/repo-clone/config $testroot/config.expected
747 c22ed3f5 2022-11-08 thomas if [ $ret -ne 0 ]; then
748 c22ed3f5 2022-11-08 thomas diff -u $testroot/config.expected \
749 c22ed3f5 2022-11-08 thomas $testroot/repo-clone/config
751 c22ed3f5 2022-11-08 thomas test_done "$testroot" "$ret"
754 c22ed3f5 2022-11-08 thomas test_clone_dangling_headref() {
755 c22ed3f5 2022-11-08 thomas local testroot=`test_init clone_dangling_headref`
756 c22ed3f5 2022-11-08 thomas local testurl=ssh://127.0.0.1/$testroot
757 c22ed3f5 2022-11-08 thomas local commit_id=`git_show_head $testroot/repo`
759 c22ed3f5 2022-11-08 thomas got branch -r $testroot/repo -d master > /dev/null
760 c22ed3f5 2022-11-08 thomas got branch -r $testroot/repo -c $commit_id foo
762 c22ed3f5 2022-11-08 thomas got ref -l -r $testroot/repo > $testroot/stdout
764 c22ed3f5 2022-11-08 thomas echo "HEAD: refs/heads/master" > $testroot/stdout.expected
765 c22ed3f5 2022-11-08 thomas echo "refs/heads/foo: $commit_id" >> $testroot/stdout.expected
766 c22ed3f5 2022-11-08 thomas # refs/heads/master is missing because it was deleted above
768 c22ed3f5 2022-11-08 thomas cmp -s $testroot/stdout $testroot/stdout.expected
770 c22ed3f5 2022-11-08 thomas if [ $ret -ne 0 ]; then
771 c22ed3f5 2022-11-08 thomas diff -u $testroot/stdout.expected $testroot/stdout
772 c22ed3f5 2022-11-08 thomas test_done "$testroot" "$ret"
776 c22ed3f5 2022-11-08 thomas got clone -q -b foo $testurl/repo $testroot/repo-clone
778 c22ed3f5 2022-11-08 thomas if [ $ret -ne 0 ]; then
779 c22ed3f5 2022-11-08 thomas echo "got clone command failed unexpectedly" >&2
780 c22ed3f5 2022-11-08 thomas test_done "$testroot" "$ret"
784 c22ed3f5 2022-11-08 thomas got ref -l -r $testroot/repo-clone > $testroot/stdout
786 c22ed3f5 2022-11-08 thomas echo "HEAD: refs/heads/foo" > $testroot/stdout.expected
787 c22ed3f5 2022-11-08 thomas echo "refs/heads/foo: $commit_id" >> $testroot/stdout.expected
788 c22ed3f5 2022-11-08 thomas echo "refs/remotes/origin/foo: $commit_id" >> $testroot/stdout.expected
790 c22ed3f5 2022-11-08 thomas cmp -s $testroot/stdout $testroot/stdout.expected
792 c22ed3f5 2022-11-08 thomas if [ $ret -ne 0 ]; then
793 c22ed3f5 2022-11-08 thomas diff -u $testroot/stdout.expected $testroot/stdout
794 c22ed3f5 2022-11-08 thomas test_done "$testroot" "$ret"
798 c22ed3f5 2022-11-08 thomas cat > $testroot/got.conf.expected <<EOF
799 c22ed3f5 2022-11-08 thomas remote "origin" {
800 c22ed3f5 2022-11-08 thomas server 127.0.0.1
801 c22ed3f5 2022-11-08 thomas protocol ssh
802 c22ed3f5 2022-11-08 thomas repository "$testroot/repo"
803 c22ed3f5 2022-11-08 thomas branch { "foo" }
806 c22ed3f5 2022-11-08 thomas cmp -s $testroot/repo-clone/got.conf $testroot/got.conf.expected
808 c22ed3f5 2022-11-08 thomas if [ $ret -ne 0 ]; then
809 c22ed3f5 2022-11-08 thomas diff -u $testroot/got.conf.expected \
810 c22ed3f5 2022-11-08 thomas $testroot/repo-clone/got.conf
811 c22ed3f5 2022-11-08 thomas test_done "$testroot" "$ret"
815 c22ed3f5 2022-11-08 thomas cat > $testroot/config.expected <<EOF
817 c22ed3f5 2022-11-08 thomas repositoryformatversion = 0
818 c22ed3f5 2022-11-08 thomas filemode = true
819 c22ed3f5 2022-11-08 thomas bare = true
821 c22ed3f5 2022-11-08 thomas [remote "origin"]
822 c22ed3f5 2022-11-08 thomas url = ssh://127.0.0.1$testroot/repo
823 c22ed3f5 2022-11-08 thomas fetch = refs/heads/foo:refs/remotes/origin/foo
824 56d0a753 2021-01-20 stsp fetch = refs/tags/*:refs/tags/*
826 a9c2d4c2 2020-09-24 stsp cmp -s $testroot/repo-clone/config $testroot/config.expected
828 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
829 a9c2d4c2 2020-09-24 stsp diff -u $testroot/config.expected \
830 a9c2d4c2 2020-09-24 stsp $testroot/repo-clone/config
832 0e4002ca 2020-03-21 stsp test_done "$testroot" "$ret"
835 7fb414ae 2020-08-08 stsp test_parseargs "$@"
836 c8c71e6e 2020-03-21 stsp run_test test_clone_basic
837 c8c71e6e 2020-03-21 stsp run_test test_clone_list
838 c8c71e6e 2020-03-21 stsp run_test test_clone_branch
839 c8c71e6e 2020-03-21 stsp run_test test_clone_all
840 c8c71e6e 2020-03-21 stsp run_test test_clone_mirror
841 c8c71e6e 2020-03-21 stsp run_test test_clone_mirror_all
842 0e4002ca 2020-03-21 stsp run_test test_clone_reference
843 0e4002ca 2020-03-21 stsp run_test test_clone_branch_and_reference
844 0e4002ca 2020-03-21 stsp run_test test_clone_reference_mirror
845 132af4a5 2021-01-05 stsp run_test test_clone_multiple_branches
846 c22ed3f5 2022-11-08 thomas run_test test_clone_dangling_headref