Blame


1 0e673013 2019-01-02 stsp #!/bin/sh
2 0e673013 2019-01-02 stsp #
3 0e673013 2019-01-02 stsp # Copyright (c) 2019 Stefan Sperling <stsp@openbsd.org>
4 0e673013 2019-01-02 stsp #
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.
8 0e673013 2019-01-02 stsp #
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.
16 0e673013 2019-01-02 stsp
17 0e673013 2019-01-02 stsp . ./common.sh
18 0e673013 2019-01-02 stsp
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`
22 0e673013 2019-01-02 stsp
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
30 0e673013 2019-01-02 stsp
31 0e673013 2019-01-02 stsp got checkout $testroot/repo $testroot/wt > $testroot/stdout
32 49c543a6 2022-03-31 naddy ret=$?
33 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
34 e60e7f5b 2019-02-10 stsp test_done "$testroot" "$ret"
35 0e673013 2019-01-02 stsp return 1
36 0e673013 2019-01-02 stsp fi
37 0e673013 2019-01-02 stsp
38 8d301dd9 2019-05-14 stsp cmp -s $testroot/stdout.expected $testroot/stdout
39 49c543a6 2022-03-31 naddy ret=$?
40 49c543a6 2022-03-31 naddy if [ $ret -ne 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"
43 0e673013 2019-01-02 stsp return 1
44 0e673013 2019-01-02 stsp fi
45 0e673013 2019-01-02 stsp
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
52 0e673013 2019-01-02 stsp
53 8d301dd9 2019-05-14 stsp cmp -s $testroot/content.expected $testroot/content
54 49c543a6 2022-03-31 naddy ret=$?
55 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
56 0e673013 2019-01-02 stsp diff -u $testroot/content.expected $testroot/content
57 0e673013 2019-01-02 stsp fi
58 693719bc 2019-01-03 stsp test_done "$testroot" "$ret"
59 0e673013 2019-01-02 stsp }
60 0e673013 2019-01-02 stsp
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`
64 80c1b583 2019-08-07 stsp
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
72 80c1b583 2019-08-07 stsp
73 80c1b583 2019-08-07 stsp mkdir $testroot/wt
74 80c1b583 2019-08-07 stsp
75 80c1b583 2019-08-07 stsp got checkout $testroot/repo $testroot/wt > $testroot/stdout
76 49c543a6 2022-03-31 naddy ret=$?
77 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
78 80c1b583 2019-08-07 stsp test_done "$testroot" "$ret"
79 80c1b583 2019-08-07 stsp return 1
80 80c1b583 2019-08-07 stsp fi
81 80c1b583 2019-08-07 stsp
82 80c1b583 2019-08-07 stsp cmp -s $testroot/stdout.expected $testroot/stdout
83 49c543a6 2022-03-31 naddy ret=$?
84 49c543a6 2022-03-31 naddy if [ $ret -ne 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"
87 80c1b583 2019-08-07 stsp return 1
88 80c1b583 2019-08-07 stsp fi
89 80c1b583 2019-08-07 stsp
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
96 80c1b583 2019-08-07 stsp
97 80c1b583 2019-08-07 stsp cmp -s $testroot/content.expected $testroot/content
98 49c543a6 2022-03-31 naddy ret=$?
99 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
100 80c1b583 2019-08-07 stsp diff -u $testroot/content.expected $testroot/content
101 80c1b583 2019-08-07 stsp fi
102 80c1b583 2019-08-07 stsp test_done "$testroot" "$ret"
103 80c1b583 2019-08-07 stsp }
104 80c1b583 2019-08-07 stsp
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`
108 80c1b583 2019-08-07 stsp
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
116 80c1b583 2019-08-07 stsp
117 80c1b583 2019-08-07 stsp mkdir $testroot/wt
118 80c1b583 2019-08-07 stsp touch $testroot/wt/foo
119 80c1b583 2019-08-07 stsp
120 80c1b583 2019-08-07 stsp got checkout $testroot/repo $testroot/wt > $testroot/stdout \
121 80c1b583 2019-08-07 stsp 2> $testroot/stderr
122 49c543a6 2022-03-31 naddy ret=$?
123 49c543a6 2022-03-31 naddy if [ $ret -eq 0 ]; then
124 80c1b583 2019-08-07 stsp echo "checkout succeeded unexpectedly" >&2
125 80c1b583 2019-08-07 stsp test_done "$testroot" "1"
126 80c1b583 2019-08-07 stsp return 1
127 80c1b583 2019-08-07 stsp fi
128 80c1b583 2019-08-07 stsp
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
132 49c543a6 2022-03-31 naddy ret=$?
133 49c543a6 2022-03-31 naddy if [ $ret -ne 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"
136 80c1b583 2019-08-07 stsp return 1
137 80c1b583 2019-08-07 stsp fi
138 80c1b583 2019-08-07 stsp
139 80c1b583 2019-08-07 stsp echo -n > $testroot/stdout.expected
140 80c1b583 2019-08-07 stsp cmp -s $testroot/stdout.expected $testroot/stdout
141 49c543a6 2022-03-31 naddy ret=$?
142 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
143 80c1b583 2019-08-07 stsp diff -u $testroot/stdout.expected $testroot/stdout
144 80c1b583 2019-08-07 stsp fi
145 80c1b583 2019-08-07 stsp test_done "$testroot" "$ret"
146 80c1b583 2019-08-07 stsp
147 80c1b583 2019-08-07 stsp }
148 80c1b583 2019-08-07 stsp
149 f6cae3ed 2020-09-13 naddy test_checkout_sets_xbit() {
150 68ed9ba5 2019-02-10 stsp local testroot=`test_init checkout_sets_xbit 1`
151 68ed9ba5 2019-02-10 stsp
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`
157 68ed9ba5 2019-02-10 stsp
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
162 68ed9ba5 2019-02-10 stsp
163 68ed9ba5 2019-02-10 stsp got checkout $testroot/repo $testroot/wt > $testroot/stdout
164 49c543a6 2022-03-31 naddy ret=$?
165 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
166 68ed9ba5 2019-02-10 stsp test_done "$testroot" "$ret"
167 68ed9ba5 2019-02-10 stsp return 1
168 68ed9ba5 2019-02-10 stsp fi
169 68ed9ba5 2019-02-10 stsp
170 8d301dd9 2019-05-14 stsp cmp -s $testroot/stdout.expected $testroot/stdout
171 49c543a6 2022-03-31 naddy ret=$?
172 49c543a6 2022-03-31 naddy if [ $ret -ne 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"
175 68ed9ba5 2019-02-10 stsp return 1
176 68ed9ba5 2019-02-10 stsp fi
177 68ed9ba5 2019-02-10 stsp
178 68ed9ba5 2019-02-10 stsp ls -l $testroot/wt/xfile | grep -q '^-rwx'
179 49c543a6 2022-03-31 naddy ret=$?
180 49c543a6 2022-03-31 naddy if [ $ret -ne 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
183 68ed9ba5 2019-02-10 stsp fi
184 68ed9ba5 2019-02-10 stsp test_done "$testroot" "$ret"
185 68ed9ba5 2019-02-10 stsp }
186 68ed9ba5 2019-02-10 stsp
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`
189 45d344f6 2019-05-14 stsp
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"
193 45d344f6 2019-05-14 stsp
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
197 49c543a6 2022-03-31 naddy ret=$?
198 49c543a6 2022-03-31 naddy if [ $ret -eq 0 ]; then
199 45d344f6 2019-05-14 stsp test_done "$testroot" "1"
200 45d344f6 2019-05-14 stsp return 1
201 45d344f6 2019-05-14 stsp fi
202 45d344f6 2019-05-14 stsp
203 45d344f6 2019-05-14 stsp echo -n "" > $testroot/stdout.expected
204 45d344f6 2019-05-14 stsp cmp -s $testroot/stdout.expected $testroot/stdout
205 49c543a6 2022-03-31 naddy ret=$?
206 49c543a6 2022-03-31 naddy if [ $ret -ne 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"
209 45d344f6 2019-05-14 stsp return 1
210 45d344f6 2019-05-14 stsp fi
211 45d344f6 2019-05-14 stsp
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
221 49c543a6 2022-03-31 naddy ret=$?
222 49c543a6 2022-03-31 naddy if [ $ret -ne 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"
225 45d344f6 2019-05-14 stsp return 1
226 45d344f6 2019-05-14 stsp fi
227 45d344f6 2019-05-14 stsp
228 45d344f6 2019-05-14 stsp test_done "$testroot" "$ret"
229 45d344f6 2019-05-14 stsp }
230 45d344f6 2019-05-14 stsp
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"
235 303e2782 2019-08-09 stsp
236 303e2782 2019-08-09 stsp (cd $testroot/repo && git tag -a -m "test" $tag)
237 303e2782 2019-08-09 stsp
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
245 303e2782 2019-08-09 stsp
246 303e2782 2019-08-09 stsp got checkout -c $tag $testroot/repo $testroot/wt > $testroot/stdout
247 49c543a6 2022-03-31 naddy ret=$?
248 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
249 303e2782 2019-08-09 stsp test_done "$testroot" "$ret"
250 303e2782 2019-08-09 stsp return 1
251 303e2782 2019-08-09 stsp fi
252 303e2782 2019-08-09 stsp
253 303e2782 2019-08-09 stsp cmp -s $testroot/stdout.expected $testroot/stdout
254 49c543a6 2022-03-31 naddy ret=$?
255 49c543a6 2022-03-31 naddy if [ $ret -ne 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"
258 303e2782 2019-08-09 stsp return 1
259 303e2782 2019-08-09 stsp fi
260 303e2782 2019-08-09 stsp
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
267 303e2782 2019-08-09 stsp
268 303e2782 2019-08-09 stsp cmp -s $testroot/content.expected $testroot/content
269 49c543a6 2022-03-31 naddy ret=$?
270 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
271 303e2782 2019-08-09 stsp diff -u $testroot/content.expected $testroot/content
272 303e2782 2019-08-09 stsp fi
273 303e2782 2019-08-09 stsp test_done "$testroot" "$ret"
274 303e2782 2019-08-09 stsp }
275 63c5ca5d 2019-08-24 stsp
276 f6cae3ed 2020-09-13 naddy test_checkout_ignores_submodules() {
277 63c5ca5d 2019-08-24 stsp local testroot=`test_init checkout_ignores_submodules`
278 63c5ca5d 2019-08-24 stsp
279 e7303626 2020-05-14 stsp make_single_file_repo $testroot/repo2 foo
280 e7303626 2020-05-14 stsp
281 f1aec6ed 2022-10-24 stsp (cd $testroot/repo && git -c protocol.file.allow=always \
282 f1aec6ed 2022-10-24 stsp submodule -q add ../repo2)
283 63c5ca5d 2019-08-24 stsp (cd $testroot/repo && git commit -q -m 'adding submodule')
284 08e5873e 2021-09-14 stsp local commit_id=`git_show_head $testroot/repo`
285 63c5ca5d 2019-08-24 stsp
286 63c5ca5d 2019-08-24 stsp echo "A $testroot/wt/.gitmodules" > $testroot/stdout.expected
287 63c5ca5d 2019-08-24 stsp echo "A $testroot/wt/alpha" >> $testroot/stdout.expected
288 63c5ca5d 2019-08-24 stsp echo "A $testroot/wt/beta" >> $testroot/stdout.expected
289 63c5ca5d 2019-08-24 stsp echo "A $testroot/wt/epsilon/zeta" >> $testroot/stdout.expected
290 63c5ca5d 2019-08-24 stsp echo "A $testroot/wt/gamma/delta" >> $testroot/stdout.expected
291 08e5873e 2021-09-14 stsp echo "Checked out refs/heads/master: $commit_id" \
292 08e5873e 2021-09-14 stsp >> $testroot/stdout.expected
293 63c5ca5d 2019-08-24 stsp echo "Now shut up and hack" >> $testroot/stdout.expected
294 303e2782 2019-08-09 stsp
295 63c5ca5d 2019-08-24 stsp got checkout $testroot/repo $testroot/wt > $testroot/stdout
296 49c543a6 2022-03-31 naddy ret=$?
297 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
298 63c5ca5d 2019-08-24 stsp test_done "$testroot" "$ret"
299 63c5ca5d 2019-08-24 stsp return 1
300 63c5ca5d 2019-08-24 stsp fi
301 63c5ca5d 2019-08-24 stsp
302 63c5ca5d 2019-08-24 stsp cmp -s $testroot/stdout.expected $testroot/stdout
303 49c543a6 2022-03-31 naddy ret=$?
304 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
305 63c5ca5d 2019-08-24 stsp diff -u $testroot/stdout.expected $testroot/stdout
306 63c5ca5d 2019-08-24 stsp test_done "$testroot" "$ret"
307 63c5ca5d 2019-08-24 stsp return 1
308 63c5ca5d 2019-08-24 stsp fi
309 63c5ca5d 2019-08-24 stsp
310 63c5ca5d 2019-08-24 stsp echo "alpha" > $testroot/content.expected
311 63c5ca5d 2019-08-24 stsp echo "beta" >> $testroot/content.expected
312 63c5ca5d 2019-08-24 stsp echo "zeta" >> $testroot/content.expected
313 63c5ca5d 2019-08-24 stsp echo "delta" >> $testroot/content.expected
314 63c5ca5d 2019-08-24 stsp cat $testroot/wt/alpha $testroot/wt/beta $testroot/wt/epsilon/zeta \
315 63c5ca5d 2019-08-24 stsp $testroot/wt/gamma/delta > $testroot/content
316 63c5ca5d 2019-08-24 stsp
317 63c5ca5d 2019-08-24 stsp cmp -s $testroot/content.expected $testroot/content
318 49c543a6 2022-03-31 naddy ret=$?
319 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
320 63c5ca5d 2019-08-24 stsp diff -u $testroot/content.expected $testroot/content
321 63c5ca5d 2019-08-24 stsp fi
322 63c5ca5d 2019-08-24 stsp test_done "$testroot" "$ret"
323 63c5ca5d 2019-08-24 stsp }
324 7f47418f 2019-12-20 stsp
325 f6cae3ed 2020-09-13 naddy test_checkout_read_only() {
326 7f47418f 2019-12-20 stsp local testroot=`test_init checkout_read_only`
327 08e5873e 2021-09-14 stsp local commit_id=`git_show_head $testroot/repo`
328 7f47418f 2019-12-20 stsp
329 7f47418f 2019-12-20 stsp # Make the repostiory read-only
330 7f47418f 2019-12-20 stsp chmod -R a-w $testroot/repo
331 7f47418f 2019-12-20 stsp
332 7f47418f 2019-12-20 stsp echo "A $testroot/wt/alpha" > $testroot/stdout.expected
333 7f47418f 2019-12-20 stsp echo "A $testroot/wt/beta" >> $testroot/stdout.expected
334 7f47418f 2019-12-20 stsp echo "A $testroot/wt/epsilon/zeta" >> $testroot/stdout.expected
335 7f47418f 2019-12-20 stsp echo "A $testroot/wt/gamma/delta" >> $testroot/stdout.expected
336 08e5873e 2021-09-14 stsp echo "Checked out refs/heads/master: $commit_id" \
337 08e5873e 2021-09-14 stsp >> $testroot/stdout.expected
338 7f47418f 2019-12-20 stsp echo "Now shut up and hack" >> $testroot/stdout.expected
339 7f47418f 2019-12-20 stsp
340 7f47418f 2019-12-20 stsp got checkout $testroot/repo $testroot/wt \
341 7f47418f 2019-12-20 stsp > $testroot/stdout 2> $testroot/stderr
342 49c543a6 2022-03-31 naddy ret=$?
343 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
344 7f47418f 2019-12-20 stsp test_done "$testroot" "$ret"
345 7f47418f 2019-12-20 stsp return 1
346 7f47418f 2019-12-20 stsp fi
347 63c5ca5d 2019-08-24 stsp
348 7f47418f 2019-12-20 stsp cmp -s $testroot/stdout.expected $testroot/stdout
349 49c543a6 2022-03-31 naddy ret=$?
350 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
351 7f47418f 2019-12-20 stsp diff -u $testroot/stdout.expected $testroot/stdout
352 7f47418f 2019-12-20 stsp test_done "$testroot" "$ret"
353 7f47418f 2019-12-20 stsp return 1
354 7f47418f 2019-12-20 stsp fi
355 7f47418f 2019-12-20 stsp
356 7f47418f 2019-12-20 stsp echo -n "got: warning: could not create a reference " \
357 7f47418f 2019-12-20 stsp > $testroot/stderr.expected
358 7f47418f 2019-12-20 stsp echo -n "to the work tree's base commit; the commit could " \
359 7f47418f 2019-12-20 stsp >> $testroot/stderr.expected
360 e6786710 2021-07-03 stsp echo -n "be garbage-collected by Git or 'gotadmin cleanup'; " \
361 7f47418f 2019-12-20 stsp >> $testroot/stderr.expected
362 e6786710 2021-07-03 stsp echo -n "making the repository " >> $testroot/stderr.expected
363 7f47418f 2019-12-20 stsp echo "writable and running 'got update' will prevent this" \
364 7f47418f 2019-12-20 stsp >> $testroot/stderr.expected
365 7f47418f 2019-12-20 stsp cmp -s $testroot/stderr.expected $testroot/stderr
366 49c543a6 2022-03-31 naddy ret=$?
367 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
368 7f47418f 2019-12-20 stsp diff -u $testroot/stderr.expected $testroot/stderr
369 7f47418f 2019-12-20 stsp test_done "$testroot" "$ret"
370 7f47418f 2019-12-20 stsp return 1
371 7f47418f 2019-12-20 stsp fi
372 7f47418f 2019-12-20 stsp
373 7f47418f 2019-12-20 stsp echo "alpha" > $testroot/content.expected
374 7f47418f 2019-12-20 stsp echo "beta" >> $testroot/content.expected
375 7f47418f 2019-12-20 stsp echo "zeta" >> $testroot/content.expected
376 7f47418f 2019-12-20 stsp echo "delta" >> $testroot/content.expected
377 7f47418f 2019-12-20 stsp cat $testroot/wt/alpha $testroot/wt/beta $testroot/wt/epsilon/zeta \
378 7f47418f 2019-12-20 stsp $testroot/wt/gamma/delta > $testroot/content
379 7f47418f 2019-12-20 stsp
380 7f47418f 2019-12-20 stsp cmp -s $testroot/content.expected $testroot/content
381 49c543a6 2022-03-31 naddy ret=$?
382 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
383 7f47418f 2019-12-20 stsp diff -u $testroot/content.expected $testroot/content
384 7f47418f 2019-12-20 stsp fi
385 7f47418f 2019-12-20 stsp chmod -R u+w $testroot/repo # make repo cleanup work
386 7f47418f 2019-12-20 stsp test_done "$testroot" "$ret"
387 7f47418f 2019-12-20 stsp }
388 bb51a5b4 2020-01-13 stsp
389 f6cae3ed 2020-09-13 naddy test_checkout_into_nonempty_dir() {
390 bb51a5b4 2020-01-13 stsp local testroot=`test_init checkout_into_nonempty_dir`
391 08e5873e 2021-09-14 stsp local commit_id=`git_show_head $testroot/repo`
392 bb51a5b4 2020-01-13 stsp
393 bb51a5b4 2020-01-13 stsp mkdir -p $testroot/wt
394 bb51a5b4 2020-01-13 stsp make_test_tree $testroot/wt
395 bb51a5b4 2020-01-13 stsp
396 bb51a5b4 2020-01-13 stsp got checkout $testroot/repo $testroot/wt > $testroot/stdout \
397 bb51a5b4 2020-01-13 stsp 2> $testroot/stderr
398 49c543a6 2022-03-31 naddy ret=$?
399 49c543a6 2022-03-31 naddy if [ $ret -eq 0 ]; then
400 bb51a5b4 2020-01-13 stsp echo "checkout succeeded unexpectedly" >&2
401 bb51a5b4 2020-01-13 stsp test_done "$testroot" "1"
402 bb51a5b4 2020-01-13 stsp return 1
403 bb51a5b4 2020-01-13 stsp fi
404 bb51a5b4 2020-01-13 stsp
405 bb51a5b4 2020-01-13 stsp echo -n > $testroot/stdout.expected
406 bb51a5b4 2020-01-13 stsp cmp -s $testroot/stdout.expected $testroot/stdout
407 49c543a6 2022-03-31 naddy ret=$?
408 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
409 bb51a5b4 2020-01-13 stsp diff -u $testroot/stdout.expected $testroot/stdout
410 bb51a5b4 2020-01-13 stsp test_done "$testroot" "$ret"
411 bb51a5b4 2020-01-13 stsp return 1
412 bb51a5b4 2020-01-13 stsp fi
413 bb51a5b4 2020-01-13 stsp
414 bb51a5b4 2020-01-13 stsp echo "got: $testroot/wt: directory exists and is not empty" \
415 bb51a5b4 2020-01-13 stsp > $testroot/stderr.expected
416 bb51a5b4 2020-01-13 stsp cmp -s $testroot/stderr.expected $testroot/stderr
417 49c543a6 2022-03-31 naddy ret=$?
418 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
419 bb51a5b4 2020-01-13 stsp diff -u $testroot/stderr.expected $testroot/stderr
420 bb51a5b4 2020-01-13 stsp test_done "$testroot" "$ret"
421 bb51a5b4 2020-01-13 stsp return 1
422 bb51a5b4 2020-01-13 stsp fi
423 bb51a5b4 2020-01-13 stsp
424 3b9f0f87 2020-07-23 stsp echo "? $testroot/wt/alpha" > $testroot/stdout.expected
425 3b9f0f87 2020-07-23 stsp echo "? $testroot/wt/beta" >> $testroot/stdout.expected
426 3b9f0f87 2020-07-23 stsp echo "? $testroot/wt/epsilon/zeta" >> $testroot/stdout.expected
427 3b9f0f87 2020-07-23 stsp echo "? $testroot/wt/gamma/delta" >> $testroot/stdout.expected
428 08e5873e 2021-09-14 stsp echo "Checked out refs/heads/master: $commit_id" \
429 08e5873e 2021-09-14 stsp >> $testroot/stdout.expected
430 bb51a5b4 2020-01-13 stsp echo "Now shut up and hack" >> $testroot/stdout.expected
431 7f47418f 2019-12-20 stsp
432 bb51a5b4 2020-01-13 stsp got checkout -E $testroot/repo $testroot/wt > $testroot/stdout
433 49c543a6 2022-03-31 naddy ret=$?
434 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
435 bb51a5b4 2020-01-13 stsp test_done "$testroot" "$ret"
436 bb51a5b4 2020-01-13 stsp return 1
437 bb51a5b4 2020-01-13 stsp fi
438 bb51a5b4 2020-01-13 stsp
439 bb51a5b4 2020-01-13 stsp cmp -s $testroot/stdout.expected $testroot/stdout
440 49c543a6 2022-03-31 naddy ret=$?
441 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
442 bb51a5b4 2020-01-13 stsp diff -u $testroot/stdout.expected $testroot/stdout
443 bb51a5b4 2020-01-13 stsp test_done "$testroot" "$ret"
444 bb51a5b4 2020-01-13 stsp return 1
445 bb51a5b4 2020-01-13 stsp fi
446 bb51a5b4 2020-01-13 stsp
447 bb51a5b4 2020-01-13 stsp echo "E $testroot/wt/alpha" > $testroot/stdout.expected
448 bb51a5b4 2020-01-13 stsp echo "E $testroot/wt/beta" >> $testroot/stdout.expected
449 bb51a5b4 2020-01-13 stsp echo "E $testroot/wt/epsilon/zeta" >> $testroot/stdout.expected
450 bb51a5b4 2020-01-13 stsp echo "E $testroot/wt/gamma/delta" >> $testroot/stdout.expected
451 08e5873e 2021-09-14 stsp echo "Checked out refs/heads/master: $commit_id" \
452 08e5873e 2021-09-14 stsp >> $testroot/stdout.expected
453 bb51a5b4 2020-01-13 stsp echo "Now shut up and hack" >> $testroot/stdout.expected
454 bb51a5b4 2020-01-13 stsp
455 bb51a5b4 2020-01-13 stsp got checkout -E $testroot/repo $testroot/wt > $testroot/stdout
456 49c543a6 2022-03-31 naddy ret=$?
457 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
458 bb51a5b4 2020-01-13 stsp test_done "$testroot" "$ret"
459 bb51a5b4 2020-01-13 stsp return 1
460 bb51a5b4 2020-01-13 stsp fi
461 bb51a5b4 2020-01-13 stsp
462 bb51a5b4 2020-01-13 stsp cmp -s $testroot/stdout.expected $testroot/stdout
463 49c543a6 2022-03-31 naddy ret=$?
464 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
465 bb51a5b4 2020-01-13 stsp diff -u $testroot/stdout.expected $testroot/stdout
466 bb51a5b4 2020-01-13 stsp test_done "$testroot" "$ret"
467 bb51a5b4 2020-01-13 stsp return 1
468 bb51a5b4 2020-01-13 stsp fi
469 bb51a5b4 2020-01-13 stsp
470 bb51a5b4 2020-01-13 stsp echo "alpha" > $testroot/content.expected
471 bb51a5b4 2020-01-13 stsp echo "beta" >> $testroot/content.expected
472 bb51a5b4 2020-01-13 stsp echo "zeta" >> $testroot/content.expected
473 bb51a5b4 2020-01-13 stsp echo "delta" >> $testroot/content.expected
474 bb51a5b4 2020-01-13 stsp cat $testroot/wt/alpha $testroot/wt/beta $testroot/wt/epsilon/zeta \
475 bb51a5b4 2020-01-13 stsp $testroot/wt/gamma/delta > $testroot/content
476 bb51a5b4 2020-01-13 stsp
477 bb51a5b4 2020-01-13 stsp cmp -s $testroot/content.expected $testroot/content
478 49c543a6 2022-03-31 naddy ret=$?
479 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
480 bb51a5b4 2020-01-13 stsp diff -u $testroot/content.expected $testroot/content
481 bb51a5b4 2020-01-13 stsp test_done "$testroot" "$ret"
482 bb51a5b4 2020-01-13 stsp return 1
483 bb51a5b4 2020-01-13 stsp fi
484 bb51a5b4 2020-01-13 stsp
485 bb51a5b4 2020-01-13 stsp echo "modified alpha" > $testroot/wt/alpha
486 bb51a5b4 2020-01-13 stsp
487 bb51a5b4 2020-01-13 stsp echo "E $testroot/wt/alpha" > $testroot/stdout.expected
488 bb51a5b4 2020-01-13 stsp echo "E $testroot/wt/beta" >> $testroot/stdout.expected
489 bb51a5b4 2020-01-13 stsp echo "E $testroot/wt/epsilon/zeta" >> $testroot/stdout.expected
490 bb51a5b4 2020-01-13 stsp echo "E $testroot/wt/gamma/delta" >> $testroot/stdout.expected
491 08e5873e 2021-09-14 stsp echo "Checked out refs/heads/master: $commit_id" \
492 08e5873e 2021-09-14 stsp >> $testroot/stdout.expected
493 bb51a5b4 2020-01-13 stsp echo "Now shut up and hack" >> $testroot/stdout.expected
494 bb51a5b4 2020-01-13 stsp
495 bb51a5b4 2020-01-13 stsp got checkout -E $testroot/repo $testroot/wt > $testroot/stdout
496 49c543a6 2022-03-31 naddy ret=$?
497 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
498 bb51a5b4 2020-01-13 stsp test_done "$testroot" "$ret"
499 bb51a5b4 2020-01-13 stsp return 1
500 bb51a5b4 2020-01-13 stsp fi
501 bb51a5b4 2020-01-13 stsp
502 bb51a5b4 2020-01-13 stsp cmp -s $testroot/stdout.expected $testroot/stdout
503 49c543a6 2022-03-31 naddy ret=$?
504 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
505 bb51a5b4 2020-01-13 stsp diff -u $testroot/stdout.expected $testroot/stdout
506 bb51a5b4 2020-01-13 stsp test_done "$testroot" "$ret"
507 bb51a5b4 2020-01-13 stsp return 1
508 bb51a5b4 2020-01-13 stsp fi
509 bb51a5b4 2020-01-13 stsp
510 bb51a5b4 2020-01-13 stsp echo "modified alpha" > $testroot/content.expected
511 bb51a5b4 2020-01-13 stsp echo "beta" >> $testroot/content.expected
512 bb51a5b4 2020-01-13 stsp echo "zeta" >> $testroot/content.expected
513 bb51a5b4 2020-01-13 stsp echo "delta" >> $testroot/content.expected
514 bb51a5b4 2020-01-13 stsp cat $testroot/wt/alpha $testroot/wt/beta $testroot/wt/epsilon/zeta \
515 bb51a5b4 2020-01-13 stsp $testroot/wt/gamma/delta > $testroot/content
516 bb51a5b4 2020-01-13 stsp
517 bb51a5b4 2020-01-13 stsp cmp -s $testroot/content.expected $testroot/content
518 49c543a6 2022-03-31 naddy ret=$?
519 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
520 bb51a5b4 2020-01-13 stsp diff -u $testroot/content.expected $testroot/content
521 bb51a5b4 2020-01-13 stsp test_done "$testroot" "$ret"
522 4da1bbe9 2020-07-19 stsp return 1
523 bb51a5b4 2020-01-13 stsp fi
524 bb51a5b4 2020-01-13 stsp
525 bb51a5b4 2020-01-13 stsp echo 'M alpha' > $testroot/stdout.expected
526 bb51a5b4 2020-01-13 stsp (cd $testroot/wt && got status > $testroot/stdout)
527 8ba819a3 2020-07-23 stsp
528 8ba819a3 2020-07-23 stsp cmp -s $testroot/stdout.expected $testroot/stdout
529 49c543a6 2022-03-31 naddy ret=$?
530 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
531 8ba819a3 2020-07-23 stsp diff -u $testroot/stdout.expected $testroot/stdout
532 8ba819a3 2020-07-23 stsp fi
533 8ba819a3 2020-07-23 stsp test_done "$testroot" "$ret"
534 8ba819a3 2020-07-23 stsp }
535 8ba819a3 2020-07-23 stsp
536 f6cae3ed 2020-09-13 naddy test_checkout_symlink() {
537 8ba819a3 2020-07-23 stsp local testroot=`test_init checkout_symlink`
538 8ba819a3 2020-07-23 stsp
539 8ba819a3 2020-07-23 stsp (cd $testroot/repo && ln -s alpha alpha.link)
540 8ba819a3 2020-07-23 stsp (cd $testroot/repo && ln -s epsilon epsilon.link)
541 8ba819a3 2020-07-23 stsp (cd $testroot/repo && ln -s /etc/passwd passwd.link)
542 b7422a2f 2020-07-23 stsp (cd $testroot/repo && ln -s passwd.link passwd2.link)
543 0ab20ee9 2020-07-23 stsp (cd $testroot/repo && ln -s ../beta epsilon/beta.link)
544 0ab20ee9 2020-07-23 stsp (cd $testroot/repo && ln -s nonexistent nonexistent.link)
545 906c123b 2020-07-23 stsp (cd $testroot/repo && ln -s .got/foo dotgotfoo.link)
546 8ba819a3 2020-07-23 stsp (cd $testroot/repo && git add .)
547 0ab20ee9 2020-07-23 stsp git_commit $testroot/repo -m "add symlinks"
548 08e5873e 2021-09-14 stsp local commit_id=`git_show_head $testroot/repo`
549 8ba819a3 2020-07-23 stsp
550 b7422a2f 2020-07-23 stsp got checkout $testroot/repo $testroot/wt > $testroot/stdout
551 49c543a6 2022-03-31 naddy ret=$?
552 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
553 b7422a2f 2020-07-23 stsp echo "got checkout failed unexpectedly" >&2
554 8ba819a3 2020-07-23 stsp test_done "$testroot" "$ret"
555 8ba819a3 2020-07-23 stsp return 1
556 8ba819a3 2020-07-23 stsp fi
557 b7422a2f 2020-07-23 stsp
558 b7422a2f 2020-07-23 stsp echo "A $testroot/wt/alpha" > $testroot/stdout.expected
559 b7422a2f 2020-07-23 stsp echo "A $testroot/wt/alpha.link" >> $testroot/stdout.expected
560 b7422a2f 2020-07-23 stsp echo "A $testroot/wt/beta" >> $testroot/stdout.expected
561 b7422a2f 2020-07-23 stsp echo "A $testroot/wt/dotgotfoo.link" >> $testroot/stdout.expected
562 b7422a2f 2020-07-23 stsp echo "A $testroot/wt/epsilon/beta.link" >> $testroot/stdout.expected
563 b7422a2f 2020-07-23 stsp echo "A $testroot/wt/epsilon/zeta" >> $testroot/stdout.expected
564 b7422a2f 2020-07-23 stsp echo "A $testroot/wt/epsilon.link" >> $testroot/stdout.expected
565 b7422a2f 2020-07-23 stsp echo "A $testroot/wt/gamma/delta" >> $testroot/stdout.expected
566 b7422a2f 2020-07-23 stsp echo "A $testroot/wt/nonexistent.link" >> $testroot/stdout.expected
567 b7422a2f 2020-07-23 stsp echo "A $testroot/wt/passwd.link" >> $testroot/stdout.expected
568 b7422a2f 2020-07-23 stsp echo "A $testroot/wt/passwd2.link" >> $testroot/stdout.expected
569 08e5873e 2021-09-14 stsp echo "Checked out refs/heads/master: $commit_id" \
570 08e5873e 2021-09-14 stsp >> $testroot/stdout.expected
571 b7422a2f 2020-07-23 stsp echo "Now shut up and hack" >> $testroot/stdout.expected
572 8ba819a3 2020-07-23 stsp
573 b7422a2f 2020-07-23 stsp cmp -s $testroot/stdout.expected $testroot/stdout
574 49c543a6 2022-03-31 naddy ret=$?
575 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
576 b7422a2f 2020-07-23 stsp diff -u $testroot/stdout.expected $testroot/stdout
577 b7422a2f 2020-07-23 stsp test_done "$testroot" "$ret"
578 b7422a2f 2020-07-23 stsp return 1
579 b7422a2f 2020-07-23 stsp fi
580 b7422a2f 2020-07-23 stsp
581 8ba819a3 2020-07-23 stsp if ! [ -h $testroot/wt/alpha.link ]; then
582 8ba819a3 2020-07-23 stsp echo "alpha.link is not a symlink"
583 8ba819a3 2020-07-23 stsp test_done "$testroot" "1"
584 8ba819a3 2020-07-23 stsp return 1
585 8ba819a3 2020-07-23 stsp fi
586 8ba819a3 2020-07-23 stsp
587 8ba819a3 2020-07-23 stsp readlink $testroot/wt/alpha.link > $testroot/stdout
588 8ba819a3 2020-07-23 stsp echo "alpha" > $testroot/stdout.expected
589 8ba819a3 2020-07-23 stsp cmp -s $testroot/stdout.expected $testroot/stdout
590 49c543a6 2022-03-31 naddy ret=$?
591 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
592 8ba819a3 2020-07-23 stsp diff -u $testroot/stdout.expected $testroot/stdout
593 8ba819a3 2020-07-23 stsp test_done "$testroot" "$ret"
594 8ba819a3 2020-07-23 stsp return 1
595 8ba819a3 2020-07-23 stsp fi
596 bb51a5b4 2020-01-13 stsp
597 8ba819a3 2020-07-23 stsp if ! [ -h $testroot/wt/epsilon.link ]; then
598 8ba819a3 2020-07-23 stsp echo "epsilon.link is not a symlink"
599 8ba819a3 2020-07-23 stsp test_done "$testroot" "1"
600 8ba819a3 2020-07-23 stsp return 1
601 8ba819a3 2020-07-23 stsp fi
602 8ba819a3 2020-07-23 stsp
603 8ba819a3 2020-07-23 stsp readlink $testroot/wt/epsilon.link > $testroot/stdout
604 8ba819a3 2020-07-23 stsp echo "epsilon" > $testroot/stdout.expected
605 bb51a5b4 2020-01-13 stsp cmp -s $testroot/stdout.expected $testroot/stdout
606 49c543a6 2022-03-31 naddy ret=$?
607 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
608 bb51a5b4 2020-01-13 stsp diff -u $testroot/stdout.expected $testroot/stdout
609 8ba819a3 2020-07-23 stsp test_done "$testroot" "$ret"
610 8ba819a3 2020-07-23 stsp return 1
611 bb51a5b4 2020-01-13 stsp fi
612 8ba819a3 2020-07-23 stsp
613 8ba819a3 2020-07-23 stsp if [ -h $testroot/wt/passwd.link ]; then
614 8ba819a3 2020-07-23 stsp echo -n "passwd.link symlink points outside of work tree: " >&2
615 8ba819a3 2020-07-23 stsp readlink $testroot/wt/passwd.link >&2
616 8ba819a3 2020-07-23 stsp test_done "$testroot" "1"
617 8ba819a3 2020-07-23 stsp return 1
618 8ba819a3 2020-07-23 stsp fi
619 8ba819a3 2020-07-23 stsp
620 8ba819a3 2020-07-23 stsp echo -n "/etc/passwd" > $testroot/content.expected
621 8ba819a3 2020-07-23 stsp cp $testroot/wt/passwd.link $testroot/content
622 8ba819a3 2020-07-23 stsp
623 8ba819a3 2020-07-23 stsp cmp -s $testroot/content.expected $testroot/content
624 49c543a6 2022-03-31 naddy ret=$?
625 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
626 8ba819a3 2020-07-23 stsp diff -u $testroot/content.expected $testroot/content
627 0ab20ee9 2020-07-23 stsp test_done "$testroot" "$ret"
628 0ab20ee9 2020-07-23 stsp return 1
629 0ab20ee9 2020-07-23 stsp fi
630 8ba819a3 2020-07-23 stsp
631 b7422a2f 2020-07-23 stsp if ! [ -h $testroot/wt/passwd2.link ]; then
632 b7422a2f 2020-07-23 stsp echo "passwd2.link is not a symlink"
633 b7422a2f 2020-07-23 stsp test_done "$testroot" "1"
634 b7422a2f 2020-07-23 stsp return 1
635 b7422a2f 2020-07-23 stsp fi
636 b7422a2f 2020-07-23 stsp
637 b7422a2f 2020-07-23 stsp readlink $testroot/wt/passwd2.link > $testroot/stdout
638 b7422a2f 2020-07-23 stsp echo "passwd.link" > $testroot/stdout.expected
639 b7422a2f 2020-07-23 stsp cmp -s $testroot/stdout.expected $testroot/stdout
640 49c543a6 2022-03-31 naddy ret=$?
641 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
642 b7422a2f 2020-07-23 stsp diff -u $testroot/stdout.expected $testroot/stdout
643 b7422a2f 2020-07-23 stsp test_done "$testroot" "$ret"
644 b7422a2f 2020-07-23 stsp return 1
645 b7422a2f 2020-07-23 stsp fi
646 b7422a2f 2020-07-23 stsp
647 0ab20ee9 2020-07-23 stsp readlink $testroot/wt/epsilon/beta.link > $testroot/stdout
648 0ab20ee9 2020-07-23 stsp echo "../beta" > $testroot/stdout.expected
649 0ab20ee9 2020-07-23 stsp cmp -s $testroot/stdout.expected $testroot/stdout
650 49c543a6 2022-03-31 naddy ret=$?
651 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
652 0ab20ee9 2020-07-23 stsp diff -u $testroot/stdout.expected $testroot/stdout
653 0ab20ee9 2020-07-23 stsp test_done "$testroot" "$ret"
654 0ab20ee9 2020-07-23 stsp return 1
655 0ab20ee9 2020-07-23 stsp fi
656 0ab20ee9 2020-07-23 stsp
657 0ab20ee9 2020-07-23 stsp readlink $testroot/wt/nonexistent.link > $testroot/stdout
658 0ab20ee9 2020-07-23 stsp echo "nonexistent" > $testroot/stdout.expected
659 0ab20ee9 2020-07-23 stsp cmp -s $testroot/stdout.expected $testroot/stdout
660 49c543a6 2022-03-31 naddy ret=$?
661 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
662 0ab20ee9 2020-07-23 stsp diff -u $testroot/stdout.expected $testroot/stdout
663 906c123b 2020-07-23 stsp test_done "$testroot" "$ret"
664 41806587 2020-07-23 stsp return 1
665 906c123b 2020-07-23 stsp fi
666 906c123b 2020-07-23 stsp
667 906c123b 2020-07-23 stsp if [ -h $testroot/wt/dotgotfoo.link ]; then
668 906c123b 2020-07-23 stsp echo -n "dotgotfoo.link symlink points into .got dir: " >&2
669 906c123b 2020-07-23 stsp readlink $testroot/wt/dotgotfoo.link >&2
670 906c123b 2020-07-23 stsp test_done "$testroot" "1"
671 906c123b 2020-07-23 stsp return 1
672 906c123b 2020-07-23 stsp fi
673 906c123b 2020-07-23 stsp
674 906c123b 2020-07-23 stsp echo -n ".got/foo" > $testroot/content.expected
675 906c123b 2020-07-23 stsp cp $testroot/wt/dotgotfoo.link $testroot/content
676 906c123b 2020-07-23 stsp
677 906c123b 2020-07-23 stsp cmp -s $testroot/content.expected $testroot/content
678 49c543a6 2022-03-31 naddy ret=$?
679 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
680 906c123b 2020-07-23 stsp diff -u $testroot/content.expected $testroot/content
681 0ab20ee9 2020-07-23 stsp fi
682 0ab20ee9 2020-07-23 stsp test_done "$testroot" "$ret"
683 bb51a5b4 2020-01-13 stsp }
684 7d61d891 2020-07-23 stsp
685 f6cae3ed 2020-09-13 naddy test_checkout_symlink_relative_wtpath() {
686 7d61d891 2020-07-23 stsp local testroot=`test_init checkout_symlink_with_wtpath`
687 7d61d891 2020-07-23 stsp
688 7d61d891 2020-07-23 stsp (cd $testroot/repo && ln -s alpha alpha.link)
689 7d61d891 2020-07-23 stsp (cd $testroot/repo && ln -s epsilon epsilon.link)
690 7d61d891 2020-07-23 stsp (cd $testroot/repo && ln -s /etc/passwd passwd.link)
691 7d61d891 2020-07-23 stsp (cd $testroot/repo && ln -s ../beta epsilon/beta.link)
692 7d61d891 2020-07-23 stsp (cd $testroot/repo && ln -s nonexistent nonexistent.link)
693 7d61d891 2020-07-23 stsp (cd $testroot/repo && ln -s .got/foo dotgotfoo.link)
694 7d61d891 2020-07-23 stsp (cd $testroot/repo && git add .)
695 7d61d891 2020-07-23 stsp git_commit $testroot/repo -m "add symlinks"
696 7d61d891 2020-07-23 stsp
697 7d61d891 2020-07-23 stsp (cd $testroot && got checkout $testroot/repo wt > /dev/null)
698 49c543a6 2022-03-31 naddy ret=$?
699 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
700 7d61d891 2020-07-23 stsp test_done "$testroot" "$ret"
701 7d61d891 2020-07-23 stsp return 1
702 7d61d891 2020-07-23 stsp fi
703 bb51a5b4 2020-01-13 stsp
704 7d61d891 2020-07-23 stsp if ! [ -h $testroot/wt/alpha.link ]; then
705 7d61d891 2020-07-23 stsp echo "alpha.link is not a symlink"
706 7d61d891 2020-07-23 stsp test_done "$testroot" "1"
707 7d61d891 2020-07-23 stsp return 1
708 7d61d891 2020-07-23 stsp fi
709 7d61d891 2020-07-23 stsp
710 7d61d891 2020-07-23 stsp readlink $testroot/wt/alpha.link > $testroot/stdout
711 7d61d891 2020-07-23 stsp echo "alpha" > $testroot/stdout.expected
712 7d61d891 2020-07-23 stsp cmp -s $testroot/stdout.expected $testroot/stdout
713 49c543a6 2022-03-31 naddy ret=$?
714 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
715 7d61d891 2020-07-23 stsp diff -u $testroot/stdout.expected $testroot/stdout
716 7d61d891 2020-07-23 stsp test_done "$testroot" "$ret"
717 7d61d891 2020-07-23 stsp return 1
718 7d61d891 2020-07-23 stsp fi
719 7d61d891 2020-07-23 stsp
720 7d61d891 2020-07-23 stsp if ! [ -h $testroot/wt/epsilon.link ]; then
721 7d61d891 2020-07-23 stsp echo "epsilon.link is not a symlink"
722 7d61d891 2020-07-23 stsp test_done "$testroot" "1"
723 7d61d891 2020-07-23 stsp return 1
724 7d61d891 2020-07-23 stsp fi
725 7d61d891 2020-07-23 stsp
726 7d61d891 2020-07-23 stsp readlink $testroot/wt/epsilon.link > $testroot/stdout
727 7d61d891 2020-07-23 stsp echo "epsilon" > $testroot/stdout.expected
728 7d61d891 2020-07-23 stsp cmp -s $testroot/stdout.expected $testroot/stdout
729 49c543a6 2022-03-31 naddy ret=$?
730 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
731 7d61d891 2020-07-23 stsp diff -u $testroot/stdout.expected $testroot/stdout
732 7d61d891 2020-07-23 stsp test_done "$testroot" "$ret"
733 7d61d891 2020-07-23 stsp return 1
734 7d61d891 2020-07-23 stsp fi
735 7d61d891 2020-07-23 stsp
736 7d61d891 2020-07-23 stsp if [ -h $testroot/wt/passwd.link ]; then
737 7d61d891 2020-07-23 stsp echo -n "passwd.link symlink points outside of work tree: " >&2
738 7d61d891 2020-07-23 stsp readlink $testroot/wt/passwd.link >&2
739 7d61d891 2020-07-23 stsp test_done "$testroot" "1"
740 7d61d891 2020-07-23 stsp return 1
741 7d61d891 2020-07-23 stsp fi
742 7d61d891 2020-07-23 stsp
743 7d61d891 2020-07-23 stsp echo -n "/etc/passwd" > $testroot/content.expected
744 7d61d891 2020-07-23 stsp cp $testroot/wt/passwd.link $testroot/content
745 7d61d891 2020-07-23 stsp
746 7d61d891 2020-07-23 stsp cmp -s $testroot/content.expected $testroot/content
747 49c543a6 2022-03-31 naddy ret=$?
748 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
749 7d61d891 2020-07-23 stsp diff -u $testroot/content.expected $testroot/content
750 7d61d891 2020-07-23 stsp test_done "$testroot" "$ret"
751 7d61d891 2020-07-23 stsp return 1
752 7d61d891 2020-07-23 stsp fi
753 7d61d891 2020-07-23 stsp
754 7d61d891 2020-07-23 stsp readlink $testroot/wt/epsilon/beta.link > $testroot/stdout
755 7d61d891 2020-07-23 stsp echo "../beta" > $testroot/stdout.expected
756 7d61d891 2020-07-23 stsp cmp -s $testroot/stdout.expected $testroot/stdout
757 49c543a6 2022-03-31 naddy ret=$?
758 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
759 7d61d891 2020-07-23 stsp diff -u $testroot/stdout.expected $testroot/stdout
760 7d61d891 2020-07-23 stsp test_done "$testroot" "$ret"
761 7d61d891 2020-07-23 stsp return 1
762 7d61d891 2020-07-23 stsp fi
763 7d61d891 2020-07-23 stsp
764 7d61d891 2020-07-23 stsp readlink $testroot/wt/nonexistent.link > $testroot/stdout
765 7d61d891 2020-07-23 stsp echo "nonexistent" > $testroot/stdout.expected
766 7d61d891 2020-07-23 stsp cmp -s $testroot/stdout.expected $testroot/stdout
767 49c543a6 2022-03-31 naddy ret=$?
768 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
769 7d61d891 2020-07-23 stsp diff -u $testroot/stdout.expected $testroot/stdout
770 7d61d891 2020-07-23 stsp test_done "$testroot" "$ret"
771 41806587 2020-07-23 stsp return 1
772 7d61d891 2020-07-23 stsp fi
773 7d61d891 2020-07-23 stsp
774 7d61d891 2020-07-23 stsp if [ -h $testroot/wt/dotgotfoo.link ]; then
775 7d61d891 2020-07-23 stsp echo -n "dotgotfoo.link symlink points into .got dir: " >&2
776 7d61d891 2020-07-23 stsp readlink $testroot/wt/dotgotfoo.link >&2
777 7d61d891 2020-07-23 stsp test_done "$testroot" "1"
778 7d61d891 2020-07-23 stsp return 1
779 7d61d891 2020-07-23 stsp fi
780 7d61d891 2020-07-23 stsp
781 7d61d891 2020-07-23 stsp echo -n ".got/foo" > $testroot/content.expected
782 7d61d891 2020-07-23 stsp cp $testroot/wt/dotgotfoo.link $testroot/content
783 7d61d891 2020-07-23 stsp
784 7d61d891 2020-07-23 stsp cmp -s $testroot/content.expected $testroot/content
785 49c543a6 2022-03-31 naddy ret=$?
786 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
787 7d61d891 2020-07-23 stsp diff -u $testroot/content.expected $testroot/content
788 7d61d891 2020-07-23 stsp fi
789 7d61d891 2020-07-23 stsp test_done "$testroot" "$ret"
790 7d61d891 2020-07-23 stsp }
791 20b7abb3 2020-10-22 stsp
792 20b7abb3 2020-10-22 stsp test_checkout_repo_with_unknown_extension() {
793 20b7abb3 2020-10-22 stsp local testroot=`test_init checkout_repo_with_unknown_extension`
794 20b7abb3 2020-10-22 stsp
795 20b7abb3 2020-10-22 stsp (cd $testroot/repo &&
796 27749ea2 2023-02-05 op git config --add extensions.badExtension foobar)
797 20b7abb3 2020-10-22 stsp (cd $testroot/repo &&
798 20b7abb3 2020-10-22 stsp git config --add extensions.otherBadExtension 0)
799 7d61d891 2020-07-23 stsp
800 20b7abb3 2020-10-22 stsp echo "got: badExtension: unsupported repository format extension" \
801 20b7abb3 2020-10-22 stsp > $testroot/stderr.expected
802 20b7abb3 2020-10-22 stsp got checkout $testroot/repo $testroot/wt \
803 20b7abb3 2020-10-22 stsp > $testroot/stdout 2> $testroot/stderr
804 20b7abb3 2020-10-22 stsp
805 49c543a6 2022-03-31 naddy ret=$?
806 49c543a6 2022-03-31 naddy if [ $ret -eq 0 ]; then
807 20b7abb3 2020-10-22 stsp echo "got checkout command succeeded unexpectedly" >&2
808 20b7abb3 2020-10-22 stsp test_done "$testroot" "1"
809 20b7abb3 2020-10-22 stsp return 1
810 20b7abb3 2020-10-22 stsp fi
811 20b7abb3 2020-10-22 stsp
812 20b7abb3 2020-10-22 stsp cmp -s $testroot/stderr.expected $testroot/stderr
813 49c543a6 2022-03-31 naddy ret=$?
814 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
815 20b7abb3 2020-10-22 stsp diff -u $testroot/stderr.expected $testroot/stderr
816 67c65ed7 2021-09-14 tracey fi
817 67c65ed7 2021-09-14 tracey test_done "$testroot" "$ret"
818 67c65ed7 2021-09-14 tracey }
819 67c65ed7 2021-09-14 tracey
820 67c65ed7 2021-09-14 tracey test_checkout_quiet() {
821 67c65ed7 2021-09-14 tracey local testroot=`test_init checkout_quiet`
822 67c65ed7 2021-09-14 tracey
823 67c65ed7 2021-09-14 tracey echo -n "Checked out refs/heads/master: " >> $testroot/stdout.expected
824 67c65ed7 2021-09-14 tracey git_show_head $testroot/repo >> $testroot/stdout.expected
825 67d7451c 2021-09-15 naddy printf "\nNow shut up and hack\n" >> $testroot/stdout.expected
826 67c65ed7 2021-09-14 tracey
827 67c65ed7 2021-09-14 tracey got checkout -q $testroot/repo $testroot/wt > $testroot/stdout
828 49c543a6 2022-03-31 naddy ret=$?
829 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
830 67c65ed7 2021-09-14 tracey test_done "$testroot" "$ret"
831 67c65ed7 2021-09-14 tracey return 1
832 67c65ed7 2021-09-14 tracey fi
833 67c65ed7 2021-09-14 tracey
834 67c65ed7 2021-09-14 tracey cmp -s $testroot/stdout.expected $testroot/stdout
835 49c543a6 2022-03-31 naddy ret=$?
836 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
837 67c65ed7 2021-09-14 tracey diff -u $testroot/stdout.expected $testroot/stdout
838 67c65ed7 2021-09-14 tracey test_done "$testroot" "$ret"
839 67c65ed7 2021-09-14 tracey return 1
840 20b7abb3 2020-10-22 stsp fi
841 67c65ed7 2021-09-14 tracey
842 67c65ed7 2021-09-14 tracey echo "alpha" > $testroot/content.expected
843 67c65ed7 2021-09-14 tracey echo "beta" >> $testroot/content.expected
844 67c65ed7 2021-09-14 tracey echo "zeta" >> $testroot/content.expected
845 67c65ed7 2021-09-14 tracey echo "delta" >> $testroot/content.expected
846 67c65ed7 2021-09-14 tracey cat $testroot/wt/alpha $testroot/wt/beta $testroot/wt/epsilon/zeta \
847 67c65ed7 2021-09-14 tracey $testroot/wt/gamma/delta > $testroot/content
848 67c65ed7 2021-09-14 tracey
849 67c65ed7 2021-09-14 tracey cmp -s $testroot/content.expected $testroot/content
850 49c543a6 2022-03-31 naddy ret=$?
851 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
852 67c65ed7 2021-09-14 tracey diff -u $testroot/content.expected $testroot/content
853 67c65ed7 2021-09-14 tracey fi
854 20b7abb3 2020-10-22 stsp test_done "$testroot" "$ret"
855 b2b3fce1 2022-10-29 op }
856 b2b3fce1 2022-10-29 op
857 b2b3fce1 2022-10-29 op test_checkout_umask() {
858 b2b3fce1 2022-10-29 op local testroot=`test_init checkout_umask`
859 b2b3fce1 2022-10-29 op
860 b2b3fce1 2022-10-29 op # using a subshell to avoid clobbering global umask
861 b2b3fce1 2022-10-29 op (umask 044 && got checkout "$testroot/repo" "$testroot/wt") \
862 b2b3fce1 2022-10-29 op >/dev/null
863 b2b3fce1 2022-10-29 op ret=$?
864 b2b3fce1 2022-10-29 op if [ $ret -ne 0 ]; then
865 b2b3fce1 2022-10-29 op test_done "$testroot" $ret
866 b2b3fce1 2022-10-29 op return 1
867 b2b3fce1 2022-10-29 op fi
868 b2b3fce1 2022-10-29 op
869 b2b3fce1 2022-10-29 op for f in alpha beta epsilon/zeta gamma/delta; do
870 b2b3fce1 2022-10-29 op ls -l "$testroot/wt/$f" | grep -q ^-rw-------
871 b2b3fce1 2022-10-29 op if [ $? -ne 0 ]; then
872 b2b3fce1 2022-10-29 op echo "$f is not 0600 after checkout" >&2
873 b2b3fce1 2022-10-29 op ls -l "$testroot/wt/$f" >&2
874 b2b3fce1 2022-10-29 op test_done "$testroot" 1
875 b2b3fce1 2022-10-29 op return 1
876 b2b3fce1 2022-10-29 op fi
877 b2b3fce1 2022-10-29 op done
878 b2b3fce1 2022-10-29 op
879 b2b3fce1 2022-10-29 op for d in epsilon gamma; do
880 b2b3fce1 2022-10-29 op ls -ld "$testroot/wt/$d" | grep -q ^drwx--x--x
881 b2b3fce1 2022-10-29 op if [ $? -ne 0 ]; then
882 b2b3fce1 2022-10-29 op echo "$d is not 711 after checkout" >&2
883 b2b3fce1 2022-10-29 op ls -ld "$testroot/wt/$d" >&2
884 b2b3fce1 2022-10-29 op test_done "$testroot" 1
885 b2b3fce1 2022-10-29 op return 1
886 b2b3fce1 2022-10-29 op fi
887 b2b3fce1 2022-10-29 op done
888 b2b3fce1 2022-10-29 op
889 b2b3fce1 2022-10-29 op test_done "$testroot" 0
890 5753b4a9 2022-10-31 stsp }
891 5753b4a9 2022-10-31 stsp
892 5753b4a9 2022-10-31 stsp test_checkout_ulimit_n() {
893 5753b4a9 2022-10-31 stsp local testroot=`test_init checkout_ulimit_n`
894 5753b4a9 2022-10-31 stsp
895 5753b4a9 2022-10-31 stsp echo -n "Checked out refs/heads/master: " >> $testroot/stdout.expected
896 5753b4a9 2022-10-31 stsp git_show_head $testroot/repo >> $testroot/stdout.expected
897 5753b4a9 2022-10-31 stsp printf "\nNow shut up and hack\n" >> $testroot/stdout.expected
898 5753b4a9 2022-10-31 stsp
899 5753b4a9 2022-10-31 stsp # Drastically reduce the number of files we are allowed to use.
900 5753b4a9 2022-10-31 stsp # This tests our down-scaling of caches which store open file handles.
901 5753b4a9 2022-10-31 stsp # Checkout should still work; if it does not, then either there is
902 5753b4a9 2022-10-31 stsp # a bug or the fixed limit used by this test case is no longer valid
903 f4c9dec9 2022-10-31 stsp # and must be raised. Use a subshell to avoid changing global ulimit.
904 113ee344 2023-01-27 tracey (ulimit -n 33; got checkout -q $testroot/repo $testroot/wt \
905 f4c9dec9 2022-10-31 stsp > $testroot/stdout)
906 5753b4a9 2022-10-31 stsp ret=$?
907 5753b4a9 2022-10-31 stsp if [ $ret -ne 0 ]; then
908 5753b4a9 2022-10-31 stsp test_done "$testroot" "$ret"
909 5753b4a9 2022-10-31 stsp return 1
910 5753b4a9 2022-10-31 stsp fi
911 5753b4a9 2022-10-31 stsp
912 5753b4a9 2022-10-31 stsp cmp -s $testroot/stdout.expected $testroot/stdout
913 5753b4a9 2022-10-31 stsp ret=$?
914 5753b4a9 2022-10-31 stsp if [ $ret -ne 0 ]; then
915 5753b4a9 2022-10-31 stsp diff -u $testroot/stdout.expected $testroot/stdout
916 5753b4a9 2022-10-31 stsp test_done "$testroot" "$ret"
917 5753b4a9 2022-10-31 stsp return 1
918 5753b4a9 2022-10-31 stsp fi
919 5753b4a9 2022-10-31 stsp
920 5753b4a9 2022-10-31 stsp echo "alpha" > $testroot/content.expected
921 5753b4a9 2022-10-31 stsp echo "beta" >> $testroot/content.expected
922 5753b4a9 2022-10-31 stsp echo "zeta" >> $testroot/content.expected
923 5753b4a9 2022-10-31 stsp echo "delta" >> $testroot/content.expected
924 5753b4a9 2022-10-31 stsp cat $testroot/wt/alpha $testroot/wt/beta $testroot/wt/epsilon/zeta \
925 5753b4a9 2022-10-31 stsp $testroot/wt/gamma/delta > $testroot/content
926 5753b4a9 2022-10-31 stsp
927 5753b4a9 2022-10-31 stsp cmp -s $testroot/content.expected $testroot/content
928 5753b4a9 2022-10-31 stsp ret=$?
929 5753b4a9 2022-10-31 stsp if [ $ret -ne 0 ]; then
930 5753b4a9 2022-10-31 stsp diff -u $testroot/content.expected $testroot/content
931 5753b4a9 2022-10-31 stsp fi
932 5753b4a9 2022-10-31 stsp test_done "$testroot" "$ret"
933 20b7abb3 2020-10-22 stsp }
934 20b7abb3 2020-10-22 stsp
935 7fb414ae 2020-08-08 stsp test_parseargs "$@"
936 0e673013 2019-01-02 stsp run_test test_checkout_basic
937 80c1b583 2019-08-07 stsp run_test test_checkout_dir_exists
938 80c1b583 2019-08-07 stsp run_test test_checkout_dir_not_empty
939 68ed9ba5 2019-02-10 stsp run_test test_checkout_sets_xbit
940 45d344f6 2019-05-14 stsp run_test test_checkout_commit_from_wrong_branch
941 303e2782 2019-08-09 stsp run_test test_checkout_tag
942 63c5ca5d 2019-08-24 stsp run_test test_checkout_ignores_submodules
943 7f47418f 2019-12-20 stsp run_test test_checkout_read_only
944 bb51a5b4 2020-01-13 stsp run_test test_checkout_into_nonempty_dir
945 8ba819a3 2020-07-23 stsp run_test test_checkout_symlink
946 7d61d891 2020-07-23 stsp run_test test_checkout_symlink_relative_wtpath
947 20b7abb3 2020-10-22 stsp run_test test_checkout_repo_with_unknown_extension
948 67c65ed7 2021-09-14 tracey run_test test_checkout_quiet
949 b2b3fce1 2022-10-29 op run_test test_checkout_umask
950 5753b4a9 2022-10-31 stsp run_test test_checkout_ulimit_n