Blame


1 c84d8c75 2019-01-02 stsp #!/bin/sh
2 c84d8c75 2019-01-02 stsp #
3 c84d8c75 2019-01-02 stsp # Copyright (c) 2019 Stefan Sperling <stsp@openbsd.org>
4 c84d8c75 2019-01-02 stsp #
5 c84d8c75 2019-01-02 stsp # Permission to use, copy, modify, and distribute this software for any
6 c84d8c75 2019-01-02 stsp # purpose with or without fee is hereby granted, provided that the above
7 c84d8c75 2019-01-02 stsp # copyright notice and this permission notice appear in all copies.
8 c84d8c75 2019-01-02 stsp #
9 c84d8c75 2019-01-02 stsp # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 c84d8c75 2019-01-02 stsp # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 c84d8c75 2019-01-02 stsp # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 c84d8c75 2019-01-02 stsp # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 c84d8c75 2019-01-02 stsp # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 c84d8c75 2019-01-02 stsp # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 c84d8c75 2019-01-02 stsp # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 c84d8c75 2019-01-02 stsp
17 c84d8c75 2019-01-02 stsp . ./common.sh
18 c84d8c75 2019-01-02 stsp
19 c84d8c75 2019-01-02 stsp function test_update_basic {
20 0fbd721f 2019-01-02 stsp local testroot=`test_init update_basic`
21 c84d8c75 2019-01-02 stsp
22 3c90ba67 2019-01-02 stsp got checkout $testroot/repo $testroot/wt > /dev/null
23 c84d8c75 2019-01-02 stsp if [ "$?" != "0" ]; then
24 c84d8c75 2019-01-02 stsp test_done "$testroot" "$?"
25 c84d8c75 2019-01-02 stsp return 1
26 c84d8c75 2019-01-02 stsp fi
27 c84d8c75 2019-01-02 stsp
28 c84d8c75 2019-01-02 stsp echo "modified alpha" > $testroot/repo/alpha
29 c84d8c75 2019-01-02 stsp git_commit $testroot/repo -m "modified alpha"
30 c84d8c75 2019-01-02 stsp
31 c84d8c75 2019-01-02 stsp echo "U alpha" > $testroot/stdout.expected
32 9c4b8182 2019-01-02 stsp echo -n "Updated to commit " >> $testroot/stdout.expected
33 9c4b8182 2019-01-02 stsp git_show_head $testroot/repo >> $testroot/stdout.expected
34 9c4b8182 2019-01-02 stsp echo >> $testroot/stdout.expected
35 c84d8c75 2019-01-02 stsp
36 c84d8c75 2019-01-02 stsp (cd $testroot/wt && got update > $testroot/stdout)
37 c84d8c75 2019-01-02 stsp
38 c84d8c75 2019-01-02 stsp cmp $testroot/stdout.expected $testroot/stdout
39 c84d8c75 2019-01-02 stsp if [ "$?" != "0" ]; then
40 c84d8c75 2019-01-02 stsp diff -u $testroot/stdout.expected $testroot/stdout
41 c84d8c75 2019-01-02 stsp test_done "$testroot" "$?"
42 c84d8c75 2019-01-02 stsp return 1
43 c84d8c75 2019-01-02 stsp fi
44 c84d8c75 2019-01-02 stsp
45 c84d8c75 2019-01-02 stsp echo "modified alpha" > $testroot/content.expected
46 52a3df9b 2019-01-06 stsp cat $testroot/wt/alpha > $testroot/content
47 c84d8c75 2019-01-02 stsp
48 c84d8c75 2019-01-02 stsp cmp $testroot/content.expected $testroot/content
49 693719bc 2019-01-03 stsp ret="$?"
50 693719bc 2019-01-03 stsp if [ "$ret" != "0" ]; then
51 c84d8c75 2019-01-02 stsp diff -u $testroot/content.expected $testroot/content
52 c84d8c75 2019-01-02 stsp fi
53 693719bc 2019-01-03 stsp test_done "$testroot" "$ret"
54 c84d8c75 2019-01-02 stsp }
55 c84d8c75 2019-01-02 stsp
56 3b4d3732 2019-01-02 stsp function test_update_adds_file {
57 3b4d3732 2019-01-02 stsp local testroot=`test_init update_adds_file`
58 3b4d3732 2019-01-02 stsp
59 3b4d3732 2019-01-02 stsp got checkout $testroot/repo $testroot/wt > /dev/null
60 3b4d3732 2019-01-02 stsp if [ "$?" != "0" ]; then
61 3b4d3732 2019-01-02 stsp test_done "$testroot" "$?"
62 3b4d3732 2019-01-02 stsp return 1
63 3b4d3732 2019-01-02 stsp fi
64 3b4d3732 2019-01-02 stsp
65 3b4d3732 2019-01-02 stsp echo "new" > $testroot/repo/gamma/new
66 3b4d3732 2019-01-02 stsp (cd $testroot/repo && git add .)
67 3b4d3732 2019-01-02 stsp git_commit $testroot/repo -m "adding a new file"
68 3b4d3732 2019-01-02 stsp
69 3b4d3732 2019-01-02 stsp echo "A gamma/new" > $testroot/stdout.expected
70 3b4d3732 2019-01-02 stsp echo -n "Updated to commit " >> $testroot/stdout.expected
71 3b4d3732 2019-01-02 stsp git_show_head $testroot/repo >> $testroot/stdout.expected
72 3b4d3732 2019-01-02 stsp echo >> $testroot/stdout.expected
73 3b4d3732 2019-01-02 stsp
74 3b4d3732 2019-01-02 stsp (cd $testroot/wt && got update > $testroot/stdout)
75 3b4d3732 2019-01-02 stsp
76 3b4d3732 2019-01-02 stsp cmp $testroot/stdout.expected $testroot/stdout
77 3b4d3732 2019-01-02 stsp if [ "$?" != "0" ]; then
78 3b4d3732 2019-01-02 stsp diff -u $testroot/stdout.expected $testroot/stdout
79 3b4d3732 2019-01-02 stsp test_done "$testroot" "$?"
80 3b4d3732 2019-01-02 stsp return 1
81 3b4d3732 2019-01-02 stsp fi
82 3b4d3732 2019-01-02 stsp
83 3b4d3732 2019-01-02 stsp echo "new" >> $testroot/content.expected
84 52a3df9b 2019-01-06 stsp cat $testroot/wt/gamma/new > $testroot/content
85 3b4d3732 2019-01-02 stsp
86 3b4d3732 2019-01-02 stsp cmp $testroot/content.expected $testroot/content
87 693719bc 2019-01-03 stsp ret="$?"
88 693719bc 2019-01-03 stsp if [ "$ret" != "0" ]; then
89 3b4d3732 2019-01-02 stsp diff -u $testroot/content.expected $testroot/content
90 3b4d3732 2019-01-02 stsp fi
91 693719bc 2019-01-03 stsp test_done "$testroot" "$ret"
92 3b4d3732 2019-01-02 stsp }
93 3b4d3732 2019-01-02 stsp
94 512f0d0e 2019-01-02 stsp function test_update_deletes_file {
95 512f0d0e 2019-01-02 stsp local testroot=`test_init update_deletes_file`
96 512f0d0e 2019-01-02 stsp
97 512f0d0e 2019-01-02 stsp got checkout $testroot/repo $testroot/wt > /dev/null
98 512f0d0e 2019-01-02 stsp if [ "$?" != "0" ]; then
99 512f0d0e 2019-01-02 stsp test_done "$testroot" "$?"
100 512f0d0e 2019-01-02 stsp return 1
101 512f0d0e 2019-01-02 stsp fi
102 512f0d0e 2019-01-02 stsp
103 512f0d0e 2019-01-02 stsp (cd $testroot/repo && git_rm $testroot/repo beta)
104 512f0d0e 2019-01-02 stsp git_commit $testroot/repo -m "deleting a file"
105 512f0d0e 2019-01-02 stsp
106 512f0d0e 2019-01-02 stsp echo "D beta" > $testroot/stdout.expected
107 512f0d0e 2019-01-02 stsp echo -n "Updated to commit " >> $testroot/stdout.expected
108 512f0d0e 2019-01-02 stsp git_show_head $testroot/repo >> $testroot/stdout.expected
109 512f0d0e 2019-01-02 stsp echo >> $testroot/stdout.expected
110 512f0d0e 2019-01-02 stsp
111 512f0d0e 2019-01-02 stsp (cd $testroot/wt && got update > $testroot/stdout)
112 512f0d0e 2019-01-02 stsp
113 512f0d0e 2019-01-02 stsp cmp $testroot/stdout.expected $testroot/stdout
114 512f0d0e 2019-01-02 stsp if [ "$?" != "0" ]; then
115 512f0d0e 2019-01-02 stsp diff -u $testroot/stdout.expected $testroot/stdout
116 512f0d0e 2019-01-02 stsp test_done "$testroot" "$?"
117 512f0d0e 2019-01-02 stsp return 1
118 512f0d0e 2019-01-02 stsp fi
119 512f0d0e 2019-01-02 stsp
120 512f0d0e 2019-01-02 stsp if [ -e $testroot/wt/beta ]; then
121 512f0d0e 2019-01-02 stsp echo "removed file beta still exists on disk" >&2
122 52a3df9b 2019-01-06 stsp test_done "$testroot" "1"
123 512f0d0e 2019-01-02 stsp return 1
124 512f0d0e 2019-01-02 stsp fi
125 512f0d0e 2019-01-02 stsp
126 52a3df9b 2019-01-06 stsp test_done "$testroot" "0"
127 512f0d0e 2019-01-02 stsp }
128 512f0d0e 2019-01-02 stsp
129 f5c49f82 2019-01-06 stsp function test_update_deletes_dir {
130 f5c49f82 2019-01-06 stsp local testroot=`test_init update_deletes_dir`
131 f5c49f82 2019-01-06 stsp
132 f5c49f82 2019-01-06 stsp got checkout $testroot/repo $testroot/wt > /dev/null
133 f5c49f82 2019-01-06 stsp if [ "$?" != "0" ]; then
134 f5c49f82 2019-01-06 stsp test_done "$testroot" "$?"
135 f5c49f82 2019-01-06 stsp return 1
136 f5c49f82 2019-01-06 stsp fi
137 f5c49f82 2019-01-06 stsp
138 f5c49f82 2019-01-06 stsp (cd $testroot/repo && git_rm $testroot/repo -r epsilon)
139 f5c49f82 2019-01-06 stsp git_commit $testroot/repo -m "deleting a directory"
140 f5c49f82 2019-01-06 stsp
141 f5c49f82 2019-01-06 stsp echo "D epsilon/zeta" > $testroot/stdout.expected
142 f5c49f82 2019-01-06 stsp echo -n "Updated to commit " >> $testroot/stdout.expected
143 f5c49f82 2019-01-06 stsp git_show_head $testroot/repo >> $testroot/stdout.expected
144 f5c49f82 2019-01-06 stsp echo >> $testroot/stdout.expected
145 f5c49f82 2019-01-06 stsp
146 f5c49f82 2019-01-06 stsp (cd $testroot/wt && got update > $testroot/stdout)
147 f5c49f82 2019-01-06 stsp
148 f5c49f82 2019-01-06 stsp cmp $testroot/stdout.expected $testroot/stdout
149 f5c49f82 2019-01-06 stsp if [ "$?" != "0" ]; then
150 f5c49f82 2019-01-06 stsp diff -u $testroot/stdout.expected $testroot/stdout
151 f5c49f82 2019-01-06 stsp test_done "$testroot" "$?"
152 f5c49f82 2019-01-06 stsp return 1
153 f5c49f82 2019-01-06 stsp fi
154 f5c49f82 2019-01-06 stsp
155 f5c49f82 2019-01-06 stsp if [ -e $testroot/wt/epsilon ]; then
156 f5c49f82 2019-01-06 stsp echo "removed dir epsilon still exists on disk" >&2
157 52a3df9b 2019-01-06 stsp test_done "$testroot" "1"
158 f5c49f82 2019-01-06 stsp return 1
159 f5c49f82 2019-01-06 stsp fi
160 f5c49f82 2019-01-06 stsp
161 52a3df9b 2019-01-06 stsp test_done "$testroot" "0"
162 f5c49f82 2019-01-06 stsp }
163 f5c49f82 2019-01-06 stsp
164 5cc266ba 2019-01-06 stsp function test_update_deletes_dir_with_path_prefix {
165 5cc266ba 2019-01-06 stsp local testroot=`test_init update_deletes_dir_with_path_prefix`
166 5cc266ba 2019-01-06 stsp local first_rev=`git_show_head $testroot/repo`
167 5cc266ba 2019-01-06 stsp
168 5cc266ba 2019-01-06 stsp mkdir $testroot/repo/epsilon/psi
169 5cc266ba 2019-01-06 stsp echo mu > $testroot/repo/epsilon/psi/mu
170 5cc266ba 2019-01-06 stsp (cd $testroot/repo && git add .)
171 5cc266ba 2019-01-06 stsp git_commit $testroot/repo -m "adding a sub-directory beneath epsilon"
172 5cc266ba 2019-01-06 stsp
173 5cc266ba 2019-01-06 stsp # check out the epsilon/ sub-tree
174 5cc266ba 2019-01-06 stsp got checkout -p epsilon $testroot/repo $testroot/wt > /dev/null
175 5cc266ba 2019-01-06 stsp if [ "$?" != "0" ]; then
176 5cc266ba 2019-01-06 stsp test_done "$testroot" "$?"
177 5cc266ba 2019-01-06 stsp return 1
178 5cc266ba 2019-01-06 stsp fi
179 5cc266ba 2019-01-06 stsp
180 5cc266ba 2019-01-06 stsp # update back to first commit and expect psi/mu to be deleted
181 5cc266ba 2019-01-06 stsp echo "D psi/mu" > $testroot/stdout.expected
182 5cc266ba 2019-01-06 stsp echo "Updated to commit $first_rev" >> $testroot/stdout.expected
183 5cc266ba 2019-01-06 stsp
184 5cc266ba 2019-01-06 stsp (cd $testroot/wt && got update -c $first_rev > $testroot/stdout)
185 5cc266ba 2019-01-06 stsp
186 5cc266ba 2019-01-06 stsp cmp $testroot/stdout.expected $testroot/stdout
187 5cc266ba 2019-01-06 stsp if [ "$?" != "0" ]; then
188 5cc266ba 2019-01-06 stsp diff -u $testroot/stdout.expected $testroot/stdout
189 5cc266ba 2019-01-06 stsp test_done "$testroot" "$?"
190 5cc266ba 2019-01-06 stsp return 1
191 5cc266ba 2019-01-06 stsp fi
192 5cc266ba 2019-01-06 stsp
193 5cc266ba 2019-01-06 stsp if [ -e $testroot/wt/psi ]; then
194 5cc266ba 2019-01-06 stsp echo "removed dir psi still exists on disk" >&2
195 5cc266ba 2019-01-06 stsp test_done "$testroot" "1"
196 5cc266ba 2019-01-06 stsp return 1
197 5cc266ba 2019-01-06 stsp fi
198 5cc266ba 2019-01-06 stsp
199 52a3df9b 2019-01-06 stsp test_done "$testroot" "0"
200 5cc266ba 2019-01-06 stsp }
201 5cc266ba 2019-01-06 stsp
202 90285c3b 2019-01-08 stsp function test_update_deletes_dir_recursively {
203 90285c3b 2019-01-08 stsp local testroot=`test_init update_deletes_dir_recursively`
204 90285c3b 2019-01-08 stsp local first_rev=`git_show_head $testroot/repo`
205 90285c3b 2019-01-08 stsp
206 90285c3b 2019-01-08 stsp mkdir $testroot/repo/epsilon/psi
207 90285c3b 2019-01-08 stsp echo mu > $testroot/repo/epsilon/psi/mu
208 90285c3b 2019-01-08 stsp mkdir $testroot/repo/epsilon/psi/chi
209 90285c3b 2019-01-08 stsp echo tau > $testroot/repo/epsilon/psi/chi/tau
210 90285c3b 2019-01-08 stsp (cd $testroot/repo && git add .)
211 90285c3b 2019-01-08 stsp git_commit $testroot/repo -m "adding a sub-directory beneath epsilon"
212 90285c3b 2019-01-08 stsp
213 90285c3b 2019-01-08 stsp # check out the epsilon/ sub-tree
214 90285c3b 2019-01-08 stsp got checkout -p epsilon $testroot/repo $testroot/wt > /dev/null
215 90285c3b 2019-01-08 stsp if [ "$?" != "0" ]; then
216 90285c3b 2019-01-08 stsp test_done "$testroot" "$?"
217 90285c3b 2019-01-08 stsp return 1
218 90285c3b 2019-01-08 stsp fi
219 90285c3b 2019-01-08 stsp
220 90285c3b 2019-01-08 stsp # update back to first commit and expect psi/mu to be deleted
221 90285c3b 2019-01-08 stsp echo "D psi/chi/tau" > $testroot/stdout.expected
222 90285c3b 2019-01-08 stsp echo "D psi/mu" >> $testroot/stdout.expected
223 90285c3b 2019-01-08 stsp echo "Updated to commit $first_rev" >> $testroot/stdout.expected
224 90285c3b 2019-01-08 stsp
225 90285c3b 2019-01-08 stsp (cd $testroot/wt && got update -c $first_rev > $testroot/stdout)
226 90285c3b 2019-01-08 stsp
227 90285c3b 2019-01-08 stsp cmp $testroot/stdout.expected $testroot/stdout
228 90285c3b 2019-01-08 stsp if [ "$?" != "0" ]; then
229 90285c3b 2019-01-08 stsp diff -u $testroot/stdout.expected $testroot/stdout
230 90285c3b 2019-01-08 stsp test_done "$testroot" "$?"
231 90285c3b 2019-01-08 stsp return 1
232 90285c3b 2019-01-08 stsp fi
233 90285c3b 2019-01-08 stsp
234 90285c3b 2019-01-08 stsp if [ -e $testroot/wt/psi ]; then
235 90285c3b 2019-01-08 stsp echo "removed dir psi still exists on disk" >&2
236 90285c3b 2019-01-08 stsp test_done "$testroot" "1"
237 90285c3b 2019-01-08 stsp return 1
238 90285c3b 2019-01-08 stsp fi
239 90285c3b 2019-01-08 stsp
240 90285c3b 2019-01-08 stsp test_done "$testroot" "0"
241 90285c3b 2019-01-08 stsp }
242 90285c3b 2019-01-08 stsp
243 4482e97b 2019-01-08 stsp function test_update_sibling_dirs_with_common_prefix {
244 4482e97b 2019-01-08 stsp local testroot=`test_init update_sibling_dirs_with_common_prefix`
245 81a30460 2019-01-08 stsp
246 81a30460 2019-01-08 stsp got checkout $testroot/repo $testroot/wt > /dev/null
247 81a30460 2019-01-08 stsp if [ "$?" != "0" ]; then
248 81a30460 2019-01-08 stsp test_done "$testroot" "$?"
249 81a30460 2019-01-08 stsp return 1
250 81a30460 2019-01-08 stsp fi
251 81a30460 2019-01-08 stsp
252 81a30460 2019-01-08 stsp mkdir $testroot/repo/epsilon2
253 81a30460 2019-01-08 stsp echo mu > $testroot/repo/epsilon2/mu
254 81a30460 2019-01-08 stsp (cd $testroot/repo && git add epsilon2/mu)
255 81a30460 2019-01-08 stsp git_commit $testroot/repo -m "adding sibling of epsilon"
256 81a30460 2019-01-08 stsp echo change > $testroot/repo/epsilon/zeta
257 81a30460 2019-01-08 stsp git_commit $testroot/repo -m "changing epsilon/zeta"
258 81a30460 2019-01-08 stsp
259 81a30460 2019-01-08 stsp echo "U epsilon/zeta" > $testroot/stdout.expected
260 81a30460 2019-01-08 stsp echo "A epsilon2/mu" >> $testroot/stdout.expected
261 81a30460 2019-01-08 stsp echo -n "Updated to commit " >> $testroot/stdout.expected
262 81a30460 2019-01-08 stsp git_show_head $testroot/repo >> $testroot/stdout.expected
263 81a30460 2019-01-08 stsp echo >> $testroot/stdout.expected
264 81a30460 2019-01-08 stsp
265 81a30460 2019-01-08 stsp (cd $testroot/wt && got update > $testroot/stdout)
266 81a30460 2019-01-08 stsp
267 81a30460 2019-01-08 stsp cmp $testroot/stdout.expected $testroot/stdout
268 81a30460 2019-01-08 stsp if [ "$?" != "0" ]; then
269 81a30460 2019-01-08 stsp diff -u $testroot/stdout.expected $testroot/stdout
270 81a30460 2019-01-08 stsp test_done "$testroot" "$?"
271 81a30460 2019-01-08 stsp return 1
272 81a30460 2019-01-08 stsp fi
273 81a30460 2019-01-08 stsp
274 81a30460 2019-01-08 stsp echo "another change" > $testroot/repo/epsilon/zeta
275 81a30460 2019-01-08 stsp git_commit $testroot/repo -m "changing epsilon/zeta again"
276 81a30460 2019-01-08 stsp
277 81a30460 2019-01-08 stsp echo "U epsilon/zeta" > $testroot/stdout.expected
278 81a30460 2019-01-08 stsp echo -n "Updated to commit " >> $testroot/stdout.expected
279 81a30460 2019-01-08 stsp git_show_head $testroot/repo >> $testroot/stdout.expected
280 81a30460 2019-01-08 stsp echo >> $testroot/stdout.expected
281 81a30460 2019-01-08 stsp
282 81a30460 2019-01-08 stsp # Bug: This update used to do delete/add epsilon2/mu again:
283 81a30460 2019-01-08 stsp # U epsilon/zeta
284 81a30460 2019-01-08 stsp # D epsilon2/mu <--- not intended
285 81a30460 2019-01-08 stsp # A epsilon2/mu <--- not intended
286 50952927 2019-01-12 stsp (cd $testroot/wt && got update > $testroot/stdout)
287 50952927 2019-01-12 stsp
288 50952927 2019-01-12 stsp cmp $testroot/stdout.expected $testroot/stdout
289 50952927 2019-01-12 stsp if [ "$?" != "0" ]; then
290 50952927 2019-01-12 stsp diff -u $testroot/stdout.expected $testroot/stdout
291 50952927 2019-01-12 stsp test_done "$testroot" "$?"
292 50952927 2019-01-12 stsp return 1
293 50952927 2019-01-12 stsp fi
294 50952927 2019-01-12 stsp
295 50952927 2019-01-12 stsp cmp $testroot/stdout.expected $testroot/stdout
296 50952927 2019-01-12 stsp if [ "$?" != "0" ]; then
297 50952927 2019-01-12 stsp diff -u $testroot/stdout.expected $testroot/stdout
298 50952927 2019-01-12 stsp test_done "$testroot" "$?"
299 50952927 2019-01-12 stsp return 1
300 50952927 2019-01-12 stsp fi
301 50952927 2019-01-12 stsp
302 50952927 2019-01-12 stsp test_done "$testroot" "0"
303 50952927 2019-01-12 stsp }
304 50952927 2019-01-12 stsp
305 50952927 2019-01-12 stsp function test_update_dir_with_dot_sibling {
306 50952927 2019-01-12 stsp local testroot=`test_init update_dir_with_dot_sibling`
307 50952927 2019-01-12 stsp
308 50952927 2019-01-12 stsp got checkout $testroot/repo $testroot/wt > /dev/null
309 50952927 2019-01-12 stsp if [ "$?" != "0" ]; then
310 50952927 2019-01-12 stsp test_done "$testroot" "$?"
311 50952927 2019-01-12 stsp return 1
312 50952927 2019-01-12 stsp fi
313 50952927 2019-01-12 stsp
314 50952927 2019-01-12 stsp echo text > $testroot/repo/epsilon.txt
315 50952927 2019-01-12 stsp (cd $testroot/repo && git add epsilon.txt)
316 50952927 2019-01-12 stsp git_commit $testroot/repo -m "adding sibling of epsilon"
317 50952927 2019-01-12 stsp echo change > $testroot/repo/epsilon/zeta
318 50952927 2019-01-12 stsp git_commit $testroot/repo -m "changing epsilon/zeta"
319 50952927 2019-01-12 stsp
320 50952927 2019-01-12 stsp echo "A epsilon.txt" > $testroot/stdout.expected
321 50952927 2019-01-12 stsp echo "U epsilon/zeta" >> $testroot/stdout.expected
322 50952927 2019-01-12 stsp echo -n "Updated to commit " >> $testroot/stdout.expected
323 50952927 2019-01-12 stsp git_show_head $testroot/repo >> $testroot/stdout.expected
324 50952927 2019-01-12 stsp echo >> $testroot/stdout.expected
325 50952927 2019-01-12 stsp
326 81a30460 2019-01-08 stsp (cd $testroot/wt && got update > $testroot/stdout)
327 81a30460 2019-01-08 stsp
328 81a30460 2019-01-08 stsp cmp $testroot/stdout.expected $testroot/stdout
329 81a30460 2019-01-08 stsp if [ "$?" != "0" ]; then
330 81a30460 2019-01-08 stsp diff -u $testroot/stdout.expected $testroot/stdout
331 81a30460 2019-01-08 stsp test_done "$testroot" "$?"
332 81a30460 2019-01-08 stsp return 1
333 81a30460 2019-01-08 stsp fi
334 81a30460 2019-01-08 stsp
335 50952927 2019-01-12 stsp echo "another change" > $testroot/repo/epsilon/zeta
336 50952927 2019-01-12 stsp git_commit $testroot/repo -m "changing epsilon/zeta again"
337 50952927 2019-01-12 stsp
338 50952927 2019-01-12 stsp echo "U epsilon/zeta" > $testroot/stdout.expected
339 50952927 2019-01-12 stsp echo -n "Updated to commit " >> $testroot/stdout.expected
340 50952927 2019-01-12 stsp git_show_head $testroot/repo >> $testroot/stdout.expected
341 50952927 2019-01-12 stsp echo >> $testroot/stdout.expected
342 50952927 2019-01-12 stsp
343 50952927 2019-01-12 stsp (cd $testroot/wt && got update > $testroot/stdout)
344 50952927 2019-01-12 stsp
345 81a30460 2019-01-08 stsp cmp $testroot/stdout.expected $testroot/stdout
346 81a30460 2019-01-08 stsp if [ "$?" != "0" ]; then
347 81a30460 2019-01-08 stsp diff -u $testroot/stdout.expected $testroot/stdout
348 81a30460 2019-01-08 stsp test_done "$testroot" "$?"
349 81a30460 2019-01-08 stsp return 1
350 81a30460 2019-01-08 stsp fi
351 81a30460 2019-01-08 stsp
352 50952927 2019-01-12 stsp cmp $testroot/stdout.expected $testroot/stdout
353 50952927 2019-01-12 stsp if [ "$?" != "0" ]; then
354 50952927 2019-01-12 stsp diff -u $testroot/stdout.expected $testroot/stdout
355 50952927 2019-01-12 stsp test_done "$testroot" "$?"
356 50952927 2019-01-12 stsp return 1
357 50952927 2019-01-12 stsp fi
358 50952927 2019-01-12 stsp
359 81a30460 2019-01-08 stsp test_done "$testroot" "0"
360 81a30460 2019-01-08 stsp }
361 81a30460 2019-01-08 stsp
362 c84d8c75 2019-01-02 stsp run_test test_update_basic
363 3b4d3732 2019-01-02 stsp run_test test_update_adds_file
364 512f0d0e 2019-01-02 stsp run_test test_update_deletes_file
365 f5c49f82 2019-01-06 stsp run_test test_update_deletes_dir
366 5cc266ba 2019-01-06 stsp run_test test_update_deletes_dir_with_path_prefix
367 90285c3b 2019-01-08 stsp run_test test_update_deletes_dir_recursively
368 4482e97b 2019-01-08 stsp run_test test_update_sibling_dirs_with_common_prefix
369 50952927 2019-01-12 stsp run_test test_update_dir_with_dot_sibling