3 0e673013 2019-01-02 stsp # Copyright (c) 2019 Stefan Sperling <stsp@openbsd.org>
5 0e673013 2019-01-02 stsp # Permission to use, copy, modify, and distribute this software for any
6 0e673013 2019-01-02 stsp # purpose with or without fee is hereby granted, provided that the above
7 0e673013 2019-01-02 stsp # copyright notice and this permission notice appear in all copies.
9 0e673013 2019-01-02 stsp # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 0e673013 2019-01-02 stsp # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 0e673013 2019-01-02 stsp # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 0e673013 2019-01-02 stsp # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 0e673013 2019-01-02 stsp # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 0e673013 2019-01-02 stsp # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 0e673013 2019-01-02 stsp # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 0e673013 2019-01-02 stsp . ./common.sh
19 f6cae3ed 2020-09-13 naddy test_checkout_basic() {
20 0e673013 2019-01-02 stsp local testroot=`test_init checkout_basic`
21 08e5873e 2021-09-14 stsp local commit_id=`git_show_head $testroot/repo`
23 0e673013 2019-01-02 stsp echo "A $testroot/wt/alpha" > $testroot/stdout.expected
24 0e673013 2019-01-02 stsp echo "A $testroot/wt/beta" >> $testroot/stdout.expected
25 0e673013 2019-01-02 stsp echo "A $testroot/wt/epsilon/zeta" >> $testroot/stdout.expected
26 0e673013 2019-01-02 stsp echo "A $testroot/wt/gamma/delta" >> $testroot/stdout.expected
27 08e5873e 2021-09-14 stsp echo "Checked out refs/heads/master: $commit_id" \
28 08e5873e 2021-09-14 stsp >> $testroot/stdout.expected
29 0e673013 2019-01-02 stsp echo "Now shut up and hack" >> $testroot/stdout.expected
31 0e673013 2019-01-02 stsp got checkout $testroot/repo $testroot/wt > $testroot/stdout
33 e60e7f5b 2019-02-10 stsp if [ "$ret" != "0" ]; then
34 e60e7f5b 2019-02-10 stsp test_done "$testroot" "$ret"
38 8d301dd9 2019-05-14 stsp cmp -s $testroot/stdout.expected $testroot/stdout
40 e60e7f5b 2019-02-10 stsp if [ "$ret" != "0" ]; then
41 0e673013 2019-01-02 stsp diff -u $testroot/stdout.expected $testroot/stdout
42 e60e7f5b 2019-02-10 stsp test_done "$testroot" "$ret"
46 0e673013 2019-01-02 stsp echo "alpha" > $testroot/content.expected
47 0e673013 2019-01-02 stsp echo "beta" >> $testroot/content.expected
48 0e673013 2019-01-02 stsp echo "zeta" >> $testroot/content.expected
49 0e673013 2019-01-02 stsp echo "delta" >> $testroot/content.expected
50 0e673013 2019-01-02 stsp cat $testroot/wt/alpha $testroot/wt/beta $testroot/wt/epsilon/zeta \
51 0e673013 2019-01-02 stsp $testroot/wt/gamma/delta > $testroot/content
53 8d301dd9 2019-05-14 stsp cmp -s $testroot/content.expected $testroot/content
55 693719bc 2019-01-03 stsp if [ "$ret" != "0" ]; then
56 0e673013 2019-01-02 stsp diff -u $testroot/content.expected $testroot/content
58 693719bc 2019-01-03 stsp test_done "$testroot" "$ret"
61 f6cae3ed 2020-09-13 naddy test_checkout_dir_exists() {
62 80c1b583 2019-08-07 stsp local testroot=`test_init checkout_dir_exists`
63 08e5873e 2021-09-14 stsp local commit_id=`git_show_head $testroot/repo`
65 80c1b583 2019-08-07 stsp echo "A $testroot/wt/alpha" > $testroot/stdout.expected
66 80c1b583 2019-08-07 stsp echo "A $testroot/wt/beta" >> $testroot/stdout.expected
67 80c1b583 2019-08-07 stsp echo "A $testroot/wt/epsilon/zeta" >> $testroot/stdout.expected
68 80c1b583 2019-08-07 stsp echo "A $testroot/wt/gamma/delta" >> $testroot/stdout.expected
69 08e5873e 2021-09-14 stsp echo "Checked out refs/heads/master: $commit_id" \
70 08e5873e 2021-09-14 stsp >> $testroot/stdout.expected
71 80c1b583 2019-08-07 stsp echo "Now shut up and hack" >> $testroot/stdout.expected
73 80c1b583 2019-08-07 stsp mkdir $testroot/wt
75 80c1b583 2019-08-07 stsp got checkout $testroot/repo $testroot/wt > $testroot/stdout
77 80c1b583 2019-08-07 stsp if [ "$ret" != "0" ]; then
78 80c1b583 2019-08-07 stsp test_done "$testroot" "$ret"
82 80c1b583 2019-08-07 stsp cmp -s $testroot/stdout.expected $testroot/stdout
84 80c1b583 2019-08-07 stsp if [ "$ret" != "0" ]; then
85 80c1b583 2019-08-07 stsp diff -u $testroot/stdout.expected $testroot/stdout
86 80c1b583 2019-08-07 stsp test_done "$testroot" "$ret"
90 80c1b583 2019-08-07 stsp echo "alpha" > $testroot/content.expected
91 80c1b583 2019-08-07 stsp echo "beta" >> $testroot/content.expected
92 80c1b583 2019-08-07 stsp echo "zeta" >> $testroot/content.expected
93 80c1b583 2019-08-07 stsp echo "delta" >> $testroot/content.expected
94 80c1b583 2019-08-07 stsp cat $testroot/wt/alpha $testroot/wt/beta $testroot/wt/epsilon/zeta \
95 80c1b583 2019-08-07 stsp $testroot/wt/gamma/delta > $testroot/content
97 80c1b583 2019-08-07 stsp cmp -s $testroot/content.expected $testroot/content
99 80c1b583 2019-08-07 stsp if [ "$ret" != "0" ]; then
100 80c1b583 2019-08-07 stsp diff -u $testroot/content.expected $testroot/content
102 80c1b583 2019-08-07 stsp test_done "$testroot" "$ret"
105 f6cae3ed 2020-09-13 naddy test_checkout_dir_not_empty() {
106 80c1b583 2019-08-07 stsp local testroot=`test_init checkout_dir_not_empty`
107 08e5873e 2021-09-14 stsp local commit_id=`git_show_head $testroot/repo`
109 80c1b583 2019-08-07 stsp echo "A $testroot/wt/alpha" > $testroot/stdout.expected
110 80c1b583 2019-08-07 stsp echo "A $testroot/wt/beta" >> $testroot/stdout.expected
111 80c1b583 2019-08-07 stsp echo "A $testroot/wt/epsilon/zeta" >> $testroot/stdout.expected
112 80c1b583 2019-08-07 stsp echo "A $testroot/wt/gamma/delta" >> $testroot/stdout.expected
113 08e5873e 2021-09-14 stsp echo "Checked out refs/heads/master: $commit_id" \
114 08e5873e 2021-09-14 stsp >> $testroot/stdout.expected
115 80c1b583 2019-08-07 stsp echo "Now shut up and hack" >> $testroot/stdout.expected
117 80c1b583 2019-08-07 stsp mkdir $testroot/wt
118 80c1b583 2019-08-07 stsp touch $testroot/wt/foo
120 80c1b583 2019-08-07 stsp got checkout $testroot/repo $testroot/wt > $testroot/stdout \
121 80c1b583 2019-08-07 stsp 2> $testroot/stderr
123 54c39596 2020-12-28 stsp if [ "$ret" = "0" ]; then
124 80c1b583 2019-08-07 stsp echo "checkout succeeded unexpectedly" >&2
125 80c1b583 2019-08-07 stsp test_done "$testroot" "1"
129 80c1b583 2019-08-07 stsp echo "got: $testroot/wt: directory exists and is not empty" \
130 80c1b583 2019-08-07 stsp > $testroot/stderr.expected
131 80c1b583 2019-08-07 stsp cmp -s $testroot/stderr.expected $testroot/stderr
133 80c1b583 2019-08-07 stsp if [ "$ret" != "0" ]; then
134 80c1b583 2019-08-07 stsp diff -u $testroot/stderr.expected $testroot/stderr
135 80c1b583 2019-08-07 stsp test_done "$testroot" "$ret"
139 80c1b583 2019-08-07 stsp echo -n > $testroot/stdout.expected
140 80c1b583 2019-08-07 stsp cmp -s $testroot/stdout.expected $testroot/stdout
142 80c1b583 2019-08-07 stsp if [ "$ret" != "0" ]; then
143 80c1b583 2019-08-07 stsp diff -u $testroot/stdout.expected $testroot/stdout
145 80c1b583 2019-08-07 stsp test_done "$testroot" "$ret"
149 f6cae3ed 2020-09-13 naddy test_checkout_sets_xbit() {
150 68ed9ba5 2019-02-10 stsp local testroot=`test_init checkout_sets_xbit 1`
152 68ed9ba5 2019-02-10 stsp touch $testroot/repo/xfile
153 68ed9ba5 2019-02-10 stsp chmod +x $testroot/repo/xfile
154 68ed9ba5 2019-02-10 stsp (cd $testroot/repo && git add .)
155 68ed9ba5 2019-02-10 stsp git_commit $testroot/repo -m "adding executable file"
156 08e5873e 2021-09-14 stsp local commit_id=`git_show_head $testroot/repo`
158 68ed9ba5 2019-02-10 stsp echo "A $testroot/wt/xfile" > $testroot/stdout.expected
159 08e5873e 2021-09-14 stsp echo "Checked out refs/heads/master: $commit_id" \
160 08e5873e 2021-09-14 stsp >> $testroot/stdout.expected
161 68ed9ba5 2019-02-10 stsp echo "Now shut up and hack" >> $testroot/stdout.expected
163 68ed9ba5 2019-02-10 stsp got checkout $testroot/repo $testroot/wt > $testroot/stdout
165 68ed9ba5 2019-02-10 stsp if [ "$ret" != "0" ]; then
166 68ed9ba5 2019-02-10 stsp test_done "$testroot" "$ret"
170 8d301dd9 2019-05-14 stsp cmp -s $testroot/stdout.expected $testroot/stdout
172 68ed9ba5 2019-02-10 stsp if [ "$ret" != "0" ]; then
173 68ed9ba5 2019-02-10 stsp diff -u $testroot/stdout.expected $testroot/stdout
174 68ed9ba5 2019-02-10 stsp test_done "$testroot" "$ret"
178 68ed9ba5 2019-02-10 stsp ls -l $testroot/wt/xfile | grep -q '^-rwx'
180 68ed9ba5 2019-02-10 stsp if [ "$ret" != "0" ]; then
181 68ed9ba5 2019-02-10 stsp echo "file is not executable" >&2
182 68ed9ba5 2019-02-10 stsp ls -l $testroot/wt/xfile >&2
184 68ed9ba5 2019-02-10 stsp test_done "$testroot" "$ret"
187 f6cae3ed 2020-09-13 naddy test_checkout_commit_from_wrong_branch() {
188 45d344f6 2019-05-14 stsp local testroot=`test_init checkout_commit_from_wrong_branch`
190 45d344f6 2019-05-14 stsp (cd $testroot/repo && git checkout -q -b newbranch)
191 45d344f6 2019-05-14 stsp echo "modified alpha on new branch" > $testroot/repo/alpha
192 45d344f6 2019-05-14 stsp git_commit $testroot/repo -m "modified alpha on new branch"
194 45d344f6 2019-05-14 stsp local head_rev=`git_show_head $testroot/repo`
195 45d344f6 2019-05-14 stsp got checkout -b master -c $head_rev $testroot/repo $testroot/wt \
196 45d344f6 2019-05-14 stsp > $testroot/stdout 2> $testroot/stderr
198 54c39596 2020-12-28 stsp if [ "$ret" = "0" ]; then
199 45d344f6 2019-05-14 stsp test_done "$testroot" "1"
203 45d344f6 2019-05-14 stsp echo -n "" > $testroot/stdout.expected
204 45d344f6 2019-05-14 stsp cmp -s $testroot/stdout.expected $testroot/stdout
206 45d344f6 2019-05-14 stsp if [ "$ret" != "0" ]; then
207 45d344f6 2019-05-14 stsp diff -u $testroot/stdout.expected $testroot/stdout
208 45d344f6 2019-05-14 stsp test_done "$testroot" "$ret"
212 4b6c9460 2020-03-05 stsp echo -n "got: target commit is not contained in branch 'master'; " \
213 45d344f6 2019-05-14 stsp > $testroot/stderr.expected
214 4b6c9460 2020-03-05 stsp echo -n "the branch to use must be specified with -b; if necessary " \
215 4b6c9460 2020-03-05 stsp >> $testroot/stderr.expected
216 4b6c9460 2020-03-05 stsp echo -n "a new branch can be created for this commit with "\
217 4b6c9460 2020-03-05 stsp >> $testroot/stderr.expected
218 4b6c9460 2020-03-05 stsp echo "'got branch -c $head_rev BRANCH_NAME'" \
219 4b6c9460 2020-03-05 stsp >> $testroot/stderr.expected
220 45d344f6 2019-05-14 stsp cmp -s $testroot/stderr.expected $testroot/stderr
222 45d344f6 2019-05-14 stsp if [ "$ret" != "0" ]; then
223 45d344f6 2019-05-14 stsp diff -u $testroot/stderr.expected $testroot/stderr
224 45d344f6 2019-05-14 stsp test_done "$testroot" "$ret"
228 45d344f6 2019-05-14 stsp test_done "$testroot" "$ret"
231 f6cae3ed 2020-09-13 naddy test_checkout_tag() {
232 303e2782 2019-08-09 stsp local testroot=`test_init checkout_tag`
233 08e5873e 2021-09-14 stsp local commit_id=`git_show_head $testroot/repo`
234 303e2782 2019-08-09 stsp local tag="1.0.0"
236 303e2782 2019-08-09 stsp (cd $testroot/repo && git tag -a -m "test" $tag)
238 303e2782 2019-08-09 stsp echo "A $testroot/wt/alpha" > $testroot/stdout.expected
239 303e2782 2019-08-09 stsp echo "A $testroot/wt/beta" >> $testroot/stdout.expected
240 303e2782 2019-08-09 stsp echo "A $testroot/wt/epsilon/zeta" >> $testroot/stdout.expected
241 303e2782 2019-08-09 stsp echo "A $testroot/wt/gamma/delta" >> $testroot/stdout.expected
242 08e5873e 2021-09-14 stsp echo "Checked out refs/heads/master: $commit_id" \
243 08e5873e 2021-09-14 stsp >> $testroot/stdout.expected
244 303e2782 2019-08-09 stsp echo "Now shut up and hack" >> $testroot/stdout.expected
246 303e2782 2019-08-09 stsp got checkout -c $tag $testroot/repo $testroot/wt > $testroot/stdout
248 303e2782 2019-08-09 stsp if [ "$ret" != "0" ]; then
249 303e2782 2019-08-09 stsp test_done "$testroot" "$ret"
253 303e2782 2019-08-09 stsp cmp -s $testroot/stdout.expected $testroot/stdout
255 303e2782 2019-08-09 stsp if [ "$ret" != "0" ]; then
256 303e2782 2019-08-09 stsp diff -u $testroot/stdout.expected $testroot/stdout
257 303e2782 2019-08-09 stsp test_done "$testroot" "$ret"
261 303e2782 2019-08-09 stsp echo "alpha" > $testroot/content.expected
262 303e2782 2019-08-09 stsp echo "beta" >> $testroot/content.expected
263 303e2782 2019-08-09 stsp echo "zeta" >> $testroot/content.expected
264 303e2782 2019-08-09 stsp echo "delta" >> $testroot/content.expected
265 303e2782 2019-08-09 stsp cat $testroot/wt/alpha $testroot/wt/beta $testroot/wt/epsilon/zeta \
266 303e2782 2019-08-09 stsp $testroot/wt/gamma/delta > $testroot/content
268 303e2782 2019-08-09 stsp cmp -s $testroot/content.expected $testroot/content
270 303e2782 2019-08-09 stsp if [ "$ret" != "0" ]; then
271 303e2782 2019-08-09 stsp diff -u $testroot/content.expected $testroot/content
273 303e2782 2019-08-09 stsp test_done "$testroot" "$ret"
276 f6cae3ed 2020-09-13 naddy test_checkout_ignores_submodules() {
277 63c5ca5d 2019-08-24 stsp local testroot=`test_init checkout_ignores_submodules`
279 e7303626 2020-05-14 stsp make_single_file_repo $testroot/repo2 foo
281 63c5ca5d 2019-08-24 stsp (cd $testroot/repo && git submodule -q add ../repo2)
282 63c5ca5d 2019-08-24 stsp (cd $testroot/repo && git commit -q -m 'adding submodule')
283 08e5873e 2021-09-14 stsp local commit_id=`git_show_head $testroot/repo`
285 63c5ca5d 2019-08-24 stsp echo "A $testroot/wt/.gitmodules" > $testroot/stdout.expected
286 63c5ca5d 2019-08-24 stsp echo "A $testroot/wt/alpha" >> $testroot/stdout.expected
287 63c5ca5d 2019-08-24 stsp echo "A $testroot/wt/beta" >> $testroot/stdout.expected
288 63c5ca5d 2019-08-24 stsp echo "A $testroot/wt/epsilon/zeta" >> $testroot/stdout.expected
289 63c5ca5d 2019-08-24 stsp echo "A $testroot/wt/gamma/delta" >> $testroot/stdout.expected
290 08e5873e 2021-09-14 stsp echo "Checked out refs/heads/master: $commit_id" \
291 08e5873e 2021-09-14 stsp >> $testroot/stdout.expected
292 63c5ca5d 2019-08-24 stsp echo "Now shut up and hack" >> $testroot/stdout.expected
294 63c5ca5d 2019-08-24 stsp got checkout $testroot/repo $testroot/wt > $testroot/stdout
296 63c5ca5d 2019-08-24 stsp if [ "$ret" != "0" ]; then
297 63c5ca5d 2019-08-24 stsp test_done "$testroot" "$ret"
301 63c5ca5d 2019-08-24 stsp cmp -s $testroot/stdout.expected $testroot/stdout
303 63c5ca5d 2019-08-24 stsp if [ "$ret" != "0" ]; then
304 63c5ca5d 2019-08-24 stsp diff -u $testroot/stdout.expected $testroot/stdout
305 63c5ca5d 2019-08-24 stsp test_done "$testroot" "$ret"
309 63c5ca5d 2019-08-24 stsp echo "alpha" > $testroot/content.expected
310 63c5ca5d 2019-08-24 stsp echo "beta" >> $testroot/content.expected
311 63c5ca5d 2019-08-24 stsp echo "zeta" >> $testroot/content.expected
312 63c5ca5d 2019-08-24 stsp echo "delta" >> $testroot/content.expected
313 63c5ca5d 2019-08-24 stsp cat $testroot/wt/alpha $testroot/wt/beta $testroot/wt/epsilon/zeta \
314 63c5ca5d 2019-08-24 stsp $testroot/wt/gamma/delta > $testroot/content
316 63c5ca5d 2019-08-24 stsp cmp -s $testroot/content.expected $testroot/content
318 63c5ca5d 2019-08-24 stsp if [ "$ret" != "0" ]; then
319 63c5ca5d 2019-08-24 stsp diff -u $testroot/content.expected $testroot/content
321 63c5ca5d 2019-08-24 stsp test_done "$testroot" "$ret"
324 f6cae3ed 2020-09-13 naddy test_checkout_read_only() {
325 7f47418f 2019-12-20 stsp local testroot=`test_init checkout_read_only`
326 08e5873e 2021-09-14 stsp local commit_id=`git_show_head $testroot/repo`
328 7f47418f 2019-12-20 stsp # Make the repostiory read-only
329 7f47418f 2019-12-20 stsp chmod -R a-w $testroot/repo
331 7f47418f 2019-12-20 stsp echo "A $testroot/wt/alpha" > $testroot/stdout.expected
332 7f47418f 2019-12-20 stsp echo "A $testroot/wt/beta" >> $testroot/stdout.expected
333 7f47418f 2019-12-20 stsp echo "A $testroot/wt/epsilon/zeta" >> $testroot/stdout.expected
334 7f47418f 2019-12-20 stsp echo "A $testroot/wt/gamma/delta" >> $testroot/stdout.expected
335 08e5873e 2021-09-14 stsp echo "Checked out refs/heads/master: $commit_id" \
336 08e5873e 2021-09-14 stsp >> $testroot/stdout.expected
337 7f47418f 2019-12-20 stsp echo "Now shut up and hack" >> $testroot/stdout.expected
339 7f47418f 2019-12-20 stsp got checkout $testroot/repo $testroot/wt \
340 7f47418f 2019-12-20 stsp > $testroot/stdout 2> $testroot/stderr
342 7f47418f 2019-12-20 stsp if [ "$ret" != "0" ]; then
343 7f47418f 2019-12-20 stsp test_done "$testroot" "$ret"
347 7f47418f 2019-12-20 stsp cmp -s $testroot/stdout.expected $testroot/stdout
349 7f47418f 2019-12-20 stsp if [ "$ret" != "0" ]; then
350 7f47418f 2019-12-20 stsp diff -u $testroot/stdout.expected $testroot/stdout
351 7f47418f 2019-12-20 stsp test_done "$testroot" "$ret"
355 7f47418f 2019-12-20 stsp echo -n "got: warning: could not create a reference " \
356 7f47418f 2019-12-20 stsp > $testroot/stderr.expected
357 7f47418f 2019-12-20 stsp echo -n "to the work tree's base commit; the commit could " \
358 7f47418f 2019-12-20 stsp >> $testroot/stderr.expected
359 e6786710 2021-07-03 stsp echo -n "be garbage-collected by Git or 'gotadmin cleanup'; " \
360 7f47418f 2019-12-20 stsp >> $testroot/stderr.expected
361 e6786710 2021-07-03 stsp echo -n "making the repository " >> $testroot/stderr.expected
362 7f47418f 2019-12-20 stsp echo "writable and running 'got update' will prevent this" \
363 7f47418f 2019-12-20 stsp >> $testroot/stderr.expected
364 7f47418f 2019-12-20 stsp cmp -s $testroot/stderr.expected $testroot/stderr
366 7f47418f 2019-12-20 stsp if [ "$ret" != "0" ]; then
367 7f47418f 2019-12-20 stsp diff -u $testroot/stderr.expected $testroot/stderr
368 7f47418f 2019-12-20 stsp test_done "$testroot" "$ret"
372 7f47418f 2019-12-20 stsp echo "alpha" > $testroot/content.expected
373 7f47418f 2019-12-20 stsp echo "beta" >> $testroot/content.expected
374 7f47418f 2019-12-20 stsp echo "zeta" >> $testroot/content.expected
375 7f47418f 2019-12-20 stsp echo "delta" >> $testroot/content.expected
376 7f47418f 2019-12-20 stsp cat $testroot/wt/alpha $testroot/wt/beta $testroot/wt/epsilon/zeta \
377 7f47418f 2019-12-20 stsp $testroot/wt/gamma/delta > $testroot/content
379 7f47418f 2019-12-20 stsp cmp -s $testroot/content.expected $testroot/content
381 7f47418f 2019-12-20 stsp if [ "$ret" != "0" ]; then
382 7f47418f 2019-12-20 stsp diff -u $testroot/content.expected $testroot/content
384 7f47418f 2019-12-20 stsp chmod -R u+w $testroot/repo # make repo cleanup work
385 7f47418f 2019-12-20 stsp test_done "$testroot" "$ret"
388 f6cae3ed 2020-09-13 naddy test_checkout_into_nonempty_dir() {
389 bb51a5b4 2020-01-13 stsp local testroot=`test_init checkout_into_nonempty_dir`
390 08e5873e 2021-09-14 stsp local commit_id=`git_show_head $testroot/repo`
392 bb51a5b4 2020-01-13 stsp mkdir -p $testroot/wt
393 bb51a5b4 2020-01-13 stsp make_test_tree $testroot/wt
395 bb51a5b4 2020-01-13 stsp got checkout $testroot/repo $testroot/wt > $testroot/stdout \
396 bb51a5b4 2020-01-13 stsp 2> $testroot/stderr
398 54c39596 2020-12-28 stsp if [ "$ret" = "0" ]; then
399 bb51a5b4 2020-01-13 stsp echo "checkout succeeded unexpectedly" >&2
400 bb51a5b4 2020-01-13 stsp test_done "$testroot" "1"
404 bb51a5b4 2020-01-13 stsp echo -n > $testroot/stdout.expected
405 bb51a5b4 2020-01-13 stsp cmp -s $testroot/stdout.expected $testroot/stdout
407 bb51a5b4 2020-01-13 stsp if [ "$ret" != "0" ]; then
408 bb51a5b4 2020-01-13 stsp diff -u $testroot/stdout.expected $testroot/stdout
409 bb51a5b4 2020-01-13 stsp test_done "$testroot" "$ret"
413 bb51a5b4 2020-01-13 stsp echo "got: $testroot/wt: directory exists and is not empty" \
414 bb51a5b4 2020-01-13 stsp > $testroot/stderr.expected
415 bb51a5b4 2020-01-13 stsp cmp -s $testroot/stderr.expected $testroot/stderr
417 bb51a5b4 2020-01-13 stsp if [ "$ret" != "0" ]; then
418 bb51a5b4 2020-01-13 stsp diff -u $testroot/stderr.expected $testroot/stderr
419 bb51a5b4 2020-01-13 stsp test_done "$testroot" "$ret"
423 3b9f0f87 2020-07-23 stsp echo "? $testroot/wt/alpha" > $testroot/stdout.expected
424 3b9f0f87 2020-07-23 stsp echo "? $testroot/wt/beta" >> $testroot/stdout.expected
425 3b9f0f87 2020-07-23 stsp echo "? $testroot/wt/epsilon/zeta" >> $testroot/stdout.expected
426 3b9f0f87 2020-07-23 stsp echo "? $testroot/wt/gamma/delta" >> $testroot/stdout.expected
427 08e5873e 2021-09-14 stsp echo "Checked out refs/heads/master: $commit_id" \
428 08e5873e 2021-09-14 stsp >> $testroot/stdout.expected
429 bb51a5b4 2020-01-13 stsp echo "Now shut up and hack" >> $testroot/stdout.expected
431 bb51a5b4 2020-01-13 stsp got checkout -E $testroot/repo $testroot/wt > $testroot/stdout
433 bb51a5b4 2020-01-13 stsp if [ "$ret" != "0" ]; then
434 bb51a5b4 2020-01-13 stsp test_done "$testroot" "$ret"
438 bb51a5b4 2020-01-13 stsp cmp -s $testroot/stdout.expected $testroot/stdout
440 bb51a5b4 2020-01-13 stsp if [ "$ret" != "0" ]; then
441 bb51a5b4 2020-01-13 stsp diff -u $testroot/stdout.expected $testroot/stdout
442 bb51a5b4 2020-01-13 stsp test_done "$testroot" "$ret"
446 bb51a5b4 2020-01-13 stsp echo "E $testroot/wt/alpha" > $testroot/stdout.expected
447 bb51a5b4 2020-01-13 stsp echo "E $testroot/wt/beta" >> $testroot/stdout.expected
448 bb51a5b4 2020-01-13 stsp echo "E $testroot/wt/epsilon/zeta" >> $testroot/stdout.expected
449 bb51a5b4 2020-01-13 stsp echo "E $testroot/wt/gamma/delta" >> $testroot/stdout.expected
450 08e5873e 2021-09-14 stsp echo "Checked out refs/heads/master: $commit_id" \
451 08e5873e 2021-09-14 stsp >> $testroot/stdout.expected
452 bb51a5b4 2020-01-13 stsp echo "Now shut up and hack" >> $testroot/stdout.expected
454 bb51a5b4 2020-01-13 stsp got checkout -E $testroot/repo $testroot/wt > $testroot/stdout
456 bb51a5b4 2020-01-13 stsp if [ "$ret" != "0" ]; then
457 bb51a5b4 2020-01-13 stsp test_done "$testroot" "$ret"
461 bb51a5b4 2020-01-13 stsp cmp -s $testroot/stdout.expected $testroot/stdout
463 bb51a5b4 2020-01-13 stsp if [ "$ret" != "0" ]; then
464 bb51a5b4 2020-01-13 stsp diff -u $testroot/stdout.expected $testroot/stdout
465 bb51a5b4 2020-01-13 stsp test_done "$testroot" "$ret"
469 bb51a5b4 2020-01-13 stsp echo "alpha" > $testroot/content.expected
470 bb51a5b4 2020-01-13 stsp echo "beta" >> $testroot/content.expected
471 bb51a5b4 2020-01-13 stsp echo "zeta" >> $testroot/content.expected
472 bb51a5b4 2020-01-13 stsp echo "delta" >> $testroot/content.expected
473 bb51a5b4 2020-01-13 stsp cat $testroot/wt/alpha $testroot/wt/beta $testroot/wt/epsilon/zeta \
474 bb51a5b4 2020-01-13 stsp $testroot/wt/gamma/delta > $testroot/content
476 bb51a5b4 2020-01-13 stsp cmp -s $testroot/content.expected $testroot/content
478 bb51a5b4 2020-01-13 stsp if [ "$ret" != "0" ]; then
479 bb51a5b4 2020-01-13 stsp diff -u $testroot/content.expected $testroot/content
480 bb51a5b4 2020-01-13 stsp test_done "$testroot" "$ret"
484 bb51a5b4 2020-01-13 stsp echo "modified alpha" > $testroot/wt/alpha
486 bb51a5b4 2020-01-13 stsp echo "E $testroot/wt/alpha" > $testroot/stdout.expected
487 bb51a5b4 2020-01-13 stsp echo "E $testroot/wt/beta" >> $testroot/stdout.expected
488 bb51a5b4 2020-01-13 stsp echo "E $testroot/wt/epsilon/zeta" >> $testroot/stdout.expected
489 bb51a5b4 2020-01-13 stsp echo "E $testroot/wt/gamma/delta" >> $testroot/stdout.expected
490 08e5873e 2021-09-14 stsp echo "Checked out refs/heads/master: $commit_id" \
491 08e5873e 2021-09-14 stsp >> $testroot/stdout.expected
492 bb51a5b4 2020-01-13 stsp echo "Now shut up and hack" >> $testroot/stdout.expected
494 bb51a5b4 2020-01-13 stsp got checkout -E $testroot/repo $testroot/wt > $testroot/stdout
496 bb51a5b4 2020-01-13 stsp if [ "$ret" != "0" ]; then
497 bb51a5b4 2020-01-13 stsp test_done "$testroot" "$ret"
501 bb51a5b4 2020-01-13 stsp cmp -s $testroot/stdout.expected $testroot/stdout
503 bb51a5b4 2020-01-13 stsp if [ "$ret" != "0" ]; then
504 bb51a5b4 2020-01-13 stsp diff -u $testroot/stdout.expected $testroot/stdout
505 bb51a5b4 2020-01-13 stsp test_done "$testroot" "$ret"
509 bb51a5b4 2020-01-13 stsp echo "modified alpha" > $testroot/content.expected
510 bb51a5b4 2020-01-13 stsp echo "beta" >> $testroot/content.expected
511 bb51a5b4 2020-01-13 stsp echo "zeta" >> $testroot/content.expected
512 bb51a5b4 2020-01-13 stsp echo "delta" >> $testroot/content.expected
513 bb51a5b4 2020-01-13 stsp cat $testroot/wt/alpha $testroot/wt/beta $testroot/wt/epsilon/zeta \
514 bb51a5b4 2020-01-13 stsp $testroot/wt/gamma/delta > $testroot/content
516 bb51a5b4 2020-01-13 stsp cmp -s $testroot/content.expected $testroot/content
518 bb51a5b4 2020-01-13 stsp if [ "$ret" != "0" ]; then
519 bb51a5b4 2020-01-13 stsp diff -u $testroot/content.expected $testroot/content
520 bb51a5b4 2020-01-13 stsp test_done "$testroot" "$ret"
524 bb51a5b4 2020-01-13 stsp echo 'M alpha' > $testroot/stdout.expected
525 bb51a5b4 2020-01-13 stsp (cd $testroot/wt && got status > $testroot/stdout)
527 8ba819a3 2020-07-23 stsp cmp -s $testroot/stdout.expected $testroot/stdout
529 8ba819a3 2020-07-23 stsp if [ "$ret" != "0" ]; then
530 8ba819a3 2020-07-23 stsp diff -u $testroot/stdout.expected $testroot/stdout
532 8ba819a3 2020-07-23 stsp test_done "$testroot" "$ret"
535 f6cae3ed 2020-09-13 naddy test_checkout_symlink() {
536 8ba819a3 2020-07-23 stsp local testroot=`test_init checkout_symlink`
538 8ba819a3 2020-07-23 stsp (cd $testroot/repo && ln -s alpha alpha.link)
539 8ba819a3 2020-07-23 stsp (cd $testroot/repo && ln -s epsilon epsilon.link)
540 8ba819a3 2020-07-23 stsp (cd $testroot/repo && ln -s /etc/passwd passwd.link)
541 b7422a2f 2020-07-23 stsp (cd $testroot/repo && ln -s passwd.link passwd2.link)
542 0ab20ee9 2020-07-23 stsp (cd $testroot/repo && ln -s ../beta epsilon/beta.link)
543 0ab20ee9 2020-07-23 stsp (cd $testroot/repo && ln -s nonexistent nonexistent.link)
544 906c123b 2020-07-23 stsp (cd $testroot/repo && ln -s .got/foo dotgotfoo.link)
545 8ba819a3 2020-07-23 stsp (cd $testroot/repo && git add .)
546 0ab20ee9 2020-07-23 stsp git_commit $testroot/repo -m "add symlinks"
547 08e5873e 2021-09-14 stsp local commit_id=`git_show_head $testroot/repo`
549 b7422a2f 2020-07-23 stsp got checkout $testroot/repo $testroot/wt > $testroot/stdout
551 8ba819a3 2020-07-23 stsp if [ "$ret" != "0" ]; then
552 b7422a2f 2020-07-23 stsp echo "got checkout failed unexpectedly" >&2
553 8ba819a3 2020-07-23 stsp test_done "$testroot" "$ret"
557 b7422a2f 2020-07-23 stsp echo "A $testroot/wt/alpha" > $testroot/stdout.expected
558 b7422a2f 2020-07-23 stsp echo "A $testroot/wt/alpha.link" >> $testroot/stdout.expected
559 b7422a2f 2020-07-23 stsp echo "A $testroot/wt/beta" >> $testroot/stdout.expected
560 b7422a2f 2020-07-23 stsp echo "A $testroot/wt/dotgotfoo.link" >> $testroot/stdout.expected
561 b7422a2f 2020-07-23 stsp echo "A $testroot/wt/epsilon/beta.link" >> $testroot/stdout.expected
562 b7422a2f 2020-07-23 stsp echo "A $testroot/wt/epsilon/zeta" >> $testroot/stdout.expected
563 b7422a2f 2020-07-23 stsp echo "A $testroot/wt/epsilon.link" >> $testroot/stdout.expected
564 b7422a2f 2020-07-23 stsp echo "A $testroot/wt/gamma/delta" >> $testroot/stdout.expected
565 b7422a2f 2020-07-23 stsp echo "A $testroot/wt/nonexistent.link" >> $testroot/stdout.expected
566 b7422a2f 2020-07-23 stsp echo "A $testroot/wt/passwd.link" >> $testroot/stdout.expected
567 b7422a2f 2020-07-23 stsp echo "A $testroot/wt/passwd2.link" >> $testroot/stdout.expected
568 08e5873e 2021-09-14 stsp echo "Checked out refs/heads/master: $commit_id" \
569 08e5873e 2021-09-14 stsp >> $testroot/stdout.expected
570 b7422a2f 2020-07-23 stsp echo "Now shut up and hack" >> $testroot/stdout.expected
572 b7422a2f 2020-07-23 stsp cmp -s $testroot/stdout.expected $testroot/stdout
574 b7422a2f 2020-07-23 stsp if [ "$ret" != "0" ]; then
575 b7422a2f 2020-07-23 stsp diff -u $testroot/stdout.expected $testroot/stdout
576 b7422a2f 2020-07-23 stsp test_done "$testroot" "$ret"
580 8ba819a3 2020-07-23 stsp if ! [ -h $testroot/wt/alpha.link ]; then
581 8ba819a3 2020-07-23 stsp echo "alpha.link is not a symlink"
582 8ba819a3 2020-07-23 stsp test_done "$testroot" "1"
586 8ba819a3 2020-07-23 stsp readlink $testroot/wt/alpha.link > $testroot/stdout
587 8ba819a3 2020-07-23 stsp echo "alpha" > $testroot/stdout.expected
588 8ba819a3 2020-07-23 stsp cmp -s $testroot/stdout.expected $testroot/stdout
590 8ba819a3 2020-07-23 stsp if [ "$ret" != "0" ]; then
591 8ba819a3 2020-07-23 stsp diff -u $testroot/stdout.expected $testroot/stdout
592 8ba819a3 2020-07-23 stsp test_done "$testroot" "$ret"
596 8ba819a3 2020-07-23 stsp if ! [ -h $testroot/wt/epsilon.link ]; then
597 8ba819a3 2020-07-23 stsp echo "epsilon.link is not a symlink"
598 8ba819a3 2020-07-23 stsp test_done "$testroot" "1"
602 8ba819a3 2020-07-23 stsp readlink $testroot/wt/epsilon.link > $testroot/stdout
603 8ba819a3 2020-07-23 stsp echo "epsilon" > $testroot/stdout.expected
604 bb51a5b4 2020-01-13 stsp cmp -s $testroot/stdout.expected $testroot/stdout
606 bb51a5b4 2020-01-13 stsp if [ "$ret" != "0" ]; then
607 bb51a5b4 2020-01-13 stsp diff -u $testroot/stdout.expected $testroot/stdout
608 8ba819a3 2020-07-23 stsp test_done "$testroot" "$ret"
612 8ba819a3 2020-07-23 stsp if [ -h $testroot/wt/passwd.link ]; then
613 8ba819a3 2020-07-23 stsp echo -n "passwd.link symlink points outside of work tree: " >&2
614 8ba819a3 2020-07-23 stsp readlink $testroot/wt/passwd.link >&2
615 8ba819a3 2020-07-23 stsp test_done "$testroot" "1"
619 8ba819a3 2020-07-23 stsp echo -n "/etc/passwd" > $testroot/content.expected
620 8ba819a3 2020-07-23 stsp cp $testroot/wt/passwd.link $testroot/content
622 8ba819a3 2020-07-23 stsp cmp -s $testroot/content.expected $testroot/content
624 8ba819a3 2020-07-23 stsp if [ "$ret" != "0" ]; then
625 8ba819a3 2020-07-23 stsp diff -u $testroot/content.expected $testroot/content
626 0ab20ee9 2020-07-23 stsp test_done "$testroot" "$ret"
630 b7422a2f 2020-07-23 stsp if ! [ -h $testroot/wt/passwd2.link ]; then
631 b7422a2f 2020-07-23 stsp echo "passwd2.link is not a symlink"
632 b7422a2f 2020-07-23 stsp test_done "$testroot" "1"
636 b7422a2f 2020-07-23 stsp readlink $testroot/wt/passwd2.link > $testroot/stdout
637 b7422a2f 2020-07-23 stsp echo "passwd.link" > $testroot/stdout.expected
638 b7422a2f 2020-07-23 stsp cmp -s $testroot/stdout.expected $testroot/stdout
640 b7422a2f 2020-07-23 stsp if [ "$ret" != "0" ]; then
641 b7422a2f 2020-07-23 stsp diff -u $testroot/stdout.expected $testroot/stdout
642 b7422a2f 2020-07-23 stsp test_done "$testroot" "$ret"
646 0ab20ee9 2020-07-23 stsp readlink $testroot/wt/epsilon/beta.link > $testroot/stdout
647 0ab20ee9 2020-07-23 stsp echo "../beta" > $testroot/stdout.expected
648 0ab20ee9 2020-07-23 stsp cmp -s $testroot/stdout.expected $testroot/stdout
650 0ab20ee9 2020-07-23 stsp if [ "$ret" != "0" ]; then
651 0ab20ee9 2020-07-23 stsp diff -u $testroot/stdout.expected $testroot/stdout
652 0ab20ee9 2020-07-23 stsp test_done "$testroot" "$ret"
656 0ab20ee9 2020-07-23 stsp readlink $testroot/wt/nonexistent.link > $testroot/stdout
657 0ab20ee9 2020-07-23 stsp echo "nonexistent" > $testroot/stdout.expected
658 0ab20ee9 2020-07-23 stsp cmp -s $testroot/stdout.expected $testroot/stdout
660 0ab20ee9 2020-07-23 stsp if [ "$ret" != "0" ]; then
661 0ab20ee9 2020-07-23 stsp diff -u $testroot/stdout.expected $testroot/stdout
662 906c123b 2020-07-23 stsp test_done "$testroot" "$ret"
666 906c123b 2020-07-23 stsp if [ -h $testroot/wt/dotgotfoo.link ]; then
667 906c123b 2020-07-23 stsp echo -n "dotgotfoo.link symlink points into .got dir: " >&2
668 906c123b 2020-07-23 stsp readlink $testroot/wt/dotgotfoo.link >&2
669 906c123b 2020-07-23 stsp test_done "$testroot" "1"
673 906c123b 2020-07-23 stsp echo -n ".got/foo" > $testroot/content.expected
674 906c123b 2020-07-23 stsp cp $testroot/wt/dotgotfoo.link $testroot/content
676 906c123b 2020-07-23 stsp cmp -s $testroot/content.expected $testroot/content
678 906c123b 2020-07-23 stsp if [ "$ret" != "0" ]; then
679 906c123b 2020-07-23 stsp diff -u $testroot/content.expected $testroot/content
681 0ab20ee9 2020-07-23 stsp test_done "$testroot" "$ret"
684 f6cae3ed 2020-09-13 naddy test_checkout_symlink_relative_wtpath() {
685 7d61d891 2020-07-23 stsp local testroot=`test_init checkout_symlink_with_wtpath`
687 7d61d891 2020-07-23 stsp (cd $testroot/repo && ln -s alpha alpha.link)
688 7d61d891 2020-07-23 stsp (cd $testroot/repo && ln -s epsilon epsilon.link)
689 7d61d891 2020-07-23 stsp (cd $testroot/repo && ln -s /etc/passwd passwd.link)
690 7d61d891 2020-07-23 stsp (cd $testroot/repo && ln -s ../beta epsilon/beta.link)
691 7d61d891 2020-07-23 stsp (cd $testroot/repo && ln -s nonexistent nonexistent.link)
692 7d61d891 2020-07-23 stsp (cd $testroot/repo && ln -s .got/foo dotgotfoo.link)
693 7d61d891 2020-07-23 stsp (cd $testroot/repo && git add .)
694 7d61d891 2020-07-23 stsp git_commit $testroot/repo -m "add symlinks"
696 7d61d891 2020-07-23 stsp (cd $testroot && got checkout $testroot/repo wt > /dev/null)
698 7d61d891 2020-07-23 stsp if [ "$ret" != "0" ]; then
699 7d61d891 2020-07-23 stsp test_done "$testroot" "$ret"
703 7d61d891 2020-07-23 stsp if ! [ -h $testroot/wt/alpha.link ]; then
704 7d61d891 2020-07-23 stsp echo "alpha.link is not a symlink"
705 7d61d891 2020-07-23 stsp test_done "$testroot" "1"
709 7d61d891 2020-07-23 stsp readlink $testroot/wt/alpha.link > $testroot/stdout
710 7d61d891 2020-07-23 stsp echo "alpha" > $testroot/stdout.expected
711 7d61d891 2020-07-23 stsp cmp -s $testroot/stdout.expected $testroot/stdout
713 7d61d891 2020-07-23 stsp if [ "$ret" != "0" ]; then
714 7d61d891 2020-07-23 stsp diff -u $testroot/stdout.expected $testroot/stdout
715 7d61d891 2020-07-23 stsp test_done "$testroot" "$ret"
719 7d61d891 2020-07-23 stsp if ! [ -h $testroot/wt/epsilon.link ]; then
720 7d61d891 2020-07-23 stsp echo "epsilon.link is not a symlink"
721 7d61d891 2020-07-23 stsp test_done "$testroot" "1"
725 7d61d891 2020-07-23 stsp readlink $testroot/wt/epsilon.link > $testroot/stdout
726 7d61d891 2020-07-23 stsp echo "epsilon" > $testroot/stdout.expected
727 7d61d891 2020-07-23 stsp cmp -s $testroot/stdout.expected $testroot/stdout
729 7d61d891 2020-07-23 stsp if [ "$ret" != "0" ]; then
730 7d61d891 2020-07-23 stsp diff -u $testroot/stdout.expected $testroot/stdout
731 7d61d891 2020-07-23 stsp test_done "$testroot" "$ret"
735 7d61d891 2020-07-23 stsp if [ -h $testroot/wt/passwd.link ]; then
736 7d61d891 2020-07-23 stsp echo -n "passwd.link symlink points outside of work tree: " >&2
737 7d61d891 2020-07-23 stsp readlink $testroot/wt/passwd.link >&2
738 7d61d891 2020-07-23 stsp test_done "$testroot" "1"
742 7d61d891 2020-07-23 stsp echo -n "/etc/passwd" > $testroot/content.expected
743 7d61d891 2020-07-23 stsp cp $testroot/wt/passwd.link $testroot/content
745 7d61d891 2020-07-23 stsp cmp -s $testroot/content.expected $testroot/content
747 7d61d891 2020-07-23 stsp if [ "$ret" != "0" ]; then
748 7d61d891 2020-07-23 stsp diff -u $testroot/content.expected $testroot/content
749 7d61d891 2020-07-23 stsp test_done "$testroot" "$ret"
753 7d61d891 2020-07-23 stsp readlink $testroot/wt/epsilon/beta.link > $testroot/stdout
754 7d61d891 2020-07-23 stsp echo "../beta" > $testroot/stdout.expected
755 7d61d891 2020-07-23 stsp cmp -s $testroot/stdout.expected $testroot/stdout
757 7d61d891 2020-07-23 stsp if [ "$ret" != "0" ]; then
758 7d61d891 2020-07-23 stsp diff -u $testroot/stdout.expected $testroot/stdout
759 7d61d891 2020-07-23 stsp test_done "$testroot" "$ret"
763 7d61d891 2020-07-23 stsp readlink $testroot/wt/nonexistent.link > $testroot/stdout
764 7d61d891 2020-07-23 stsp echo "nonexistent" > $testroot/stdout.expected
765 7d61d891 2020-07-23 stsp cmp -s $testroot/stdout.expected $testroot/stdout
767 7d61d891 2020-07-23 stsp if [ "$ret" != "0" ]; then
768 7d61d891 2020-07-23 stsp diff -u $testroot/stdout.expected $testroot/stdout
769 7d61d891 2020-07-23 stsp test_done "$testroot" "$ret"
773 7d61d891 2020-07-23 stsp if [ -h $testroot/wt/dotgotfoo.link ]; then
774 7d61d891 2020-07-23 stsp echo -n "dotgotfoo.link symlink points into .got dir: " >&2
775 7d61d891 2020-07-23 stsp readlink $testroot/wt/dotgotfoo.link >&2
776 7d61d891 2020-07-23 stsp test_done "$testroot" "1"
780 7d61d891 2020-07-23 stsp echo -n ".got/foo" > $testroot/content.expected
781 7d61d891 2020-07-23 stsp cp $testroot/wt/dotgotfoo.link $testroot/content
783 7d61d891 2020-07-23 stsp cmp -s $testroot/content.expected $testroot/content
785 7d61d891 2020-07-23 stsp if [ "$ret" != "0" ]; then
786 7d61d891 2020-07-23 stsp diff -u $testroot/content.expected $testroot/content
788 7d61d891 2020-07-23 stsp test_done "$testroot" "$ret"
791 20b7abb3 2020-10-22 stsp test_checkout_repo_with_unknown_extension() {
792 20b7abb3 2020-10-22 stsp local testroot=`test_init checkout_repo_with_unknown_extension`
794 20b7abb3 2020-10-22 stsp (cd $testroot/repo &&
795 20b7abb3 2020-10-22 stsp git config --add extensions.badExtension true)
796 20b7abb3 2020-10-22 stsp (cd $testroot/repo &&
797 20b7abb3 2020-10-22 stsp git config --add extensions.otherBadExtension 0)
799 20b7abb3 2020-10-22 stsp echo "got: badExtension: unsupported repository format extension" \
800 20b7abb3 2020-10-22 stsp > $testroot/stderr.expected
801 20b7abb3 2020-10-22 stsp got checkout $testroot/repo $testroot/wt \
802 20b7abb3 2020-10-22 stsp > $testroot/stdout 2> $testroot/stderr
805 54c39596 2020-12-28 stsp if [ "$ret" = "0" ]; then
806 20b7abb3 2020-10-22 stsp echo "got checkout command succeeded unexpectedly" >&2
807 20b7abb3 2020-10-22 stsp test_done "$testroot" "1"
811 20b7abb3 2020-10-22 stsp cmp -s $testroot/stderr.expected $testroot/stderr
813 20b7abb3 2020-10-22 stsp if [ "$ret" != "0" ]; then
814 20b7abb3 2020-10-22 stsp diff -u $testroot/stderr.expected $testroot/stderr
816 67c65ed7 2021-09-14 tracey test_done "$testroot" "$ret"
819 67c65ed7 2021-09-14 tracey test_checkout_quiet() {
820 67c65ed7 2021-09-14 tracey local testroot=`test_init checkout_quiet`
822 67c65ed7 2021-09-14 tracey echo -n "Checked out refs/heads/master: " >> $testroot/stdout.expected
823 67c65ed7 2021-09-14 tracey git_show_head $testroot/repo >> $testroot/stdout.expected
824 67d7451c 2021-09-15 naddy printf "\nNow shut up and hack\n" >> $testroot/stdout.expected
826 67c65ed7 2021-09-14 tracey got checkout -q $testroot/repo $testroot/wt > $testroot/stdout
828 67c65ed7 2021-09-14 tracey if [ "$ret" != "0" ]; then
829 67c65ed7 2021-09-14 tracey test_done "$testroot" "$ret"
833 67c65ed7 2021-09-14 tracey cmp -s $testroot/stdout.expected $testroot/stdout
835 67c65ed7 2021-09-14 tracey if [ "$ret" != "0" ]; then
836 67c65ed7 2021-09-14 tracey diff -u $testroot/stdout.expected $testroot/stdout
837 67c65ed7 2021-09-14 tracey test_done "$testroot" "$ret"
841 67c65ed7 2021-09-14 tracey echo "alpha" > $testroot/content.expected
842 67c65ed7 2021-09-14 tracey echo "beta" >> $testroot/content.expected
843 67c65ed7 2021-09-14 tracey echo "zeta" >> $testroot/content.expected
844 67c65ed7 2021-09-14 tracey echo "delta" >> $testroot/content.expected
845 67c65ed7 2021-09-14 tracey cat $testroot/wt/alpha $testroot/wt/beta $testroot/wt/epsilon/zeta \
846 67c65ed7 2021-09-14 tracey $testroot/wt/gamma/delta > $testroot/content
848 67c65ed7 2021-09-14 tracey cmp -s $testroot/content.expected $testroot/content
850 67c65ed7 2021-09-14 tracey if [ "$ret" != "0" ]; then
851 67c65ed7 2021-09-14 tracey diff -u $testroot/content.expected $testroot/content
853 20b7abb3 2020-10-22 stsp test_done "$testroot" "$ret"
856 7fb414ae 2020-08-08 stsp test_parseargs "$@"
857 0e673013 2019-01-02 stsp run_test test_checkout_basic
858 80c1b583 2019-08-07 stsp run_test test_checkout_dir_exists
859 80c1b583 2019-08-07 stsp run_test test_checkout_dir_not_empty
860 68ed9ba5 2019-02-10 stsp run_test test_checkout_sets_xbit
861 45d344f6 2019-05-14 stsp run_test test_checkout_commit_from_wrong_branch
862 303e2782 2019-08-09 stsp run_test test_checkout_tag
863 63c5ca5d 2019-08-24 stsp run_test test_checkout_ignores_submodules
864 7f47418f 2019-12-20 stsp run_test test_checkout_read_only
865 bb51a5b4 2020-01-13 stsp run_test test_checkout_into_nonempty_dir
866 8ba819a3 2020-07-23 stsp run_test test_checkout_symlink
867 7d61d891 2020-07-23 stsp run_test test_checkout_symlink_relative_wtpath
868 20b7abb3 2020-10-22 stsp run_test test_checkout_repo_with_unknown_extension
869 67c65ed7 2021-09-14 tracey run_test test_checkout_quiet