Blame


1 c4296144 2019-05-09 stsp #!/bin/sh
2 c4296144 2019-05-09 stsp #
3 c4296144 2019-05-09 stsp # Copyright (c) 2019 Stefan Sperling <stsp@openbsd.org>
4 c4296144 2019-05-09 stsp #
5 c4296144 2019-05-09 stsp # Permission to use, copy, modify, and distribute this software for any
6 c4296144 2019-05-09 stsp # purpose with or without fee is hereby granted, provided that the above
7 c4296144 2019-05-09 stsp # copyright notice and this permission notice appear in all copies.
8 c4296144 2019-05-09 stsp #
9 c4296144 2019-05-09 stsp # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 c4296144 2019-05-09 stsp # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 c4296144 2019-05-09 stsp # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 c4296144 2019-05-09 stsp # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 c4296144 2019-05-09 stsp # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 c4296144 2019-05-09 stsp # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 c4296144 2019-05-09 stsp # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 c4296144 2019-05-09 stsp
17 c4296144 2019-05-09 stsp . ./common.sh
18 c4296144 2019-05-09 stsp
19 c4296144 2019-05-09 stsp function test_commit_basic {
20 c4296144 2019-05-09 stsp local testroot=`test_init commit_basic`
21 c4296144 2019-05-09 stsp
22 c4296144 2019-05-09 stsp got checkout $testroot/repo $testroot/wt > /dev/null
23 c4296144 2019-05-09 stsp ret="$?"
24 c4296144 2019-05-09 stsp if [ "$ret" != "0" ]; then
25 c4296144 2019-05-09 stsp test_done "$testroot" "$ret"
26 c4296144 2019-05-09 stsp return 1
27 c4296144 2019-05-09 stsp fi
28 c4296144 2019-05-09 stsp
29 c4296144 2019-05-09 stsp echo "modified alpha" > $testroot/wt/alpha
30 c4296144 2019-05-09 stsp (cd $testroot/wt && got rm beta >/dev/null)
31 c4296144 2019-05-09 stsp echo "new file" > $testroot/wt/new
32 c4296144 2019-05-09 stsp (cd $testroot/wt && got add new >/dev/null)
33 c4296144 2019-05-09 stsp
34 83a7ae6d 2019-05-10 stsp (cd $testroot/wt && got commit -m 'test commit_basic' > $testroot/stdout)
35 c4296144 2019-05-09 stsp
36 c4296144 2019-05-09 stsp local head_rev=`git_show_head $testroot/repo`
37 afa376bf 2019-05-09 stsp echo "A new" > $testroot/stdout.expected
38 afa376bf 2019-05-09 stsp echo "M alpha" >> $testroot/stdout.expected
39 afa376bf 2019-05-09 stsp echo "D beta" >> $testroot/stdout.expected
40 a7648d7a 2019-06-02 stsp echo "Created commit $head_rev" >> $testroot/stdout.expected
41 c4296144 2019-05-09 stsp
42 8d301dd9 2019-05-14 stsp cmp -s $testroot/stdout.expected $testroot/stdout
43 c4296144 2019-05-09 stsp ret="$?"
44 c4296144 2019-05-09 stsp if [ "$ret" != "0" ]; then
45 c4296144 2019-05-09 stsp diff -u $testroot/stdout.expected $testroot/stdout
46 c4296144 2019-05-09 stsp fi
47 c4296144 2019-05-09 stsp test_done "$testroot" "$ret"
48 c4296144 2019-05-09 stsp }
49 c4296144 2019-05-09 stsp
50 baa7dcfa 2019-05-09 stsp function test_commit_new_subdir {
51 baa7dcfa 2019-05-09 stsp local testroot=`test_init commit_new_subdir`
52 baa7dcfa 2019-05-09 stsp
53 baa7dcfa 2019-05-09 stsp got checkout $testroot/repo $testroot/wt > /dev/null
54 baa7dcfa 2019-05-09 stsp ret="$?"
55 baa7dcfa 2019-05-09 stsp if [ "$ret" != "0" ]; then
56 baa7dcfa 2019-05-09 stsp test_done "$testroot" "$ret"
57 baa7dcfa 2019-05-09 stsp return 1
58 baa7dcfa 2019-05-09 stsp fi
59 baa7dcfa 2019-05-09 stsp
60 baa7dcfa 2019-05-09 stsp mkdir -p $testroot/wt/d
61 baa7dcfa 2019-05-09 stsp echo "new file" > $testroot/wt/d/new
62 baa7dcfa 2019-05-09 stsp echo "another new file" > $testroot/wt/d/new2
63 baa7dcfa 2019-05-09 stsp (cd $testroot/wt && got add d/new >/dev/null)
64 baa7dcfa 2019-05-09 stsp (cd $testroot/wt && got add d/new2 >/dev/null)
65 baa7dcfa 2019-05-09 stsp
66 baa7dcfa 2019-05-09 stsp (cd $testroot/wt && \
67 baa7dcfa 2019-05-09 stsp got commit -m 'test commit_new_subdir' > $testroot/stdout)
68 baa7dcfa 2019-05-09 stsp
69 baa7dcfa 2019-05-09 stsp local head_rev=`git_show_head $testroot/repo`
70 baa7dcfa 2019-05-09 stsp echo "A d/new" > $testroot/stdout.expected
71 baa7dcfa 2019-05-09 stsp echo "A d/new2" >> $testroot/stdout.expected
72 a7648d7a 2019-06-02 stsp echo "Created commit $head_rev" >> $testroot/stdout.expected
73 baa7dcfa 2019-05-09 stsp
74 8d301dd9 2019-05-14 stsp cmp -s $testroot/stdout.expected $testroot/stdout
75 baa7dcfa 2019-05-09 stsp ret="$?"
76 baa7dcfa 2019-05-09 stsp if [ "$ret" != "0" ]; then
77 baa7dcfa 2019-05-09 stsp diff -u $testroot/stdout.expected $testroot/stdout
78 baa7dcfa 2019-05-09 stsp fi
79 baa7dcfa 2019-05-09 stsp test_done "$testroot" "$ret"
80 baa7dcfa 2019-05-09 stsp }
81 baa7dcfa 2019-05-09 stsp
82 bc70eb79 2019-05-09 stsp function test_commit_subdir {
83 bc70eb79 2019-05-09 stsp local testroot=`test_init commit_subdir`
84 bc70eb79 2019-05-09 stsp
85 bc70eb79 2019-05-09 stsp got checkout $testroot/repo $testroot/wt > /dev/null
86 bc70eb79 2019-05-09 stsp ret="$?"
87 bc70eb79 2019-05-09 stsp if [ "$ret" != "0" ]; then
88 bc70eb79 2019-05-09 stsp test_done "$testroot" "$ret"
89 bc70eb79 2019-05-09 stsp return 1
90 bc70eb79 2019-05-09 stsp fi
91 bc70eb79 2019-05-09 stsp
92 bc70eb79 2019-05-09 stsp echo "modified alpha" > $testroot/wt/alpha
93 bc70eb79 2019-05-09 stsp echo "modified zeta" > $testroot/wt/epsilon/zeta
94 bc70eb79 2019-05-09 stsp
95 bc70eb79 2019-05-09 stsp (cd $testroot/wt && \
96 bc70eb79 2019-05-09 stsp got commit -m 'test commit_subdir' epsilon > $testroot/stdout)
97 bc70eb79 2019-05-09 stsp
98 bc70eb79 2019-05-09 stsp local head_rev=`git_show_head $testroot/repo`
99 bc70eb79 2019-05-09 stsp echo "M epsilon/zeta" >> $testroot/stdout.expected
100 a7648d7a 2019-06-02 stsp echo "Created commit $head_rev" >> $testroot/stdout.expected
101 bc70eb79 2019-05-09 stsp
102 8d301dd9 2019-05-14 stsp cmp -s $testroot/stdout.expected $testroot/stdout
103 bc70eb79 2019-05-09 stsp ret="$?"
104 bc70eb79 2019-05-09 stsp if [ "$ret" != "0" ]; then
105 bc70eb79 2019-05-09 stsp diff -u $testroot/stdout.expected $testroot/stdout
106 bc70eb79 2019-05-09 stsp fi
107 bc70eb79 2019-05-09 stsp test_done "$testroot" "$ret"
108 bc70eb79 2019-05-09 stsp }
109 bc70eb79 2019-05-09 stsp
110 5bbcb68b 2019-05-09 stsp function test_commit_single_file {
111 5bbcb68b 2019-05-09 stsp local testroot=`test_init commit_single_file`
112 5bbcb68b 2019-05-09 stsp
113 5bbcb68b 2019-05-09 stsp got checkout $testroot/repo $testroot/wt > /dev/null
114 5bbcb68b 2019-05-09 stsp ret="$?"
115 5bbcb68b 2019-05-09 stsp if [ "$ret" != "0" ]; then
116 5bbcb68b 2019-05-09 stsp test_done "$testroot" "$ret"
117 5bbcb68b 2019-05-09 stsp return 1
118 5bbcb68b 2019-05-09 stsp fi
119 5bbcb68b 2019-05-09 stsp
120 5bbcb68b 2019-05-09 stsp echo "modified alpha" > $testroot/wt/alpha
121 5bbcb68b 2019-05-09 stsp echo "modified zeta" > $testroot/wt/epsilon/zeta
122 5bbcb68b 2019-05-09 stsp
123 1a36436d 2019-06-10 stsp (cd $testroot/wt && got commit -m 'changed zeta' epsilon/zeta \
124 5bbcb68b 2019-05-09 stsp > $testroot/stdout)
125 5bbcb68b 2019-05-09 stsp
126 5bbcb68b 2019-05-09 stsp local head_rev=`git_show_head $testroot/repo`
127 5bbcb68b 2019-05-09 stsp echo "M epsilon/zeta" >> $testroot/stdout.expected
128 a7648d7a 2019-06-02 stsp echo "Created commit $head_rev" >> $testroot/stdout.expected
129 5bbcb68b 2019-05-09 stsp
130 8d301dd9 2019-05-14 stsp cmp -s $testroot/stdout.expected $testroot/stdout
131 5bbcb68b 2019-05-09 stsp ret="$?"
132 5bbcb68b 2019-05-09 stsp if [ "$ret" != "0" ]; then
133 5bbcb68b 2019-05-09 stsp diff -u $testroot/stdout.expected $testroot/stdout
134 5bbcb68b 2019-05-09 stsp fi
135 5bbcb68b 2019-05-09 stsp test_done "$testroot" "$ret"
136 5bbcb68b 2019-05-09 stsp }
137 5bbcb68b 2019-05-09 stsp
138 819f385b 2019-05-10 stsp function test_commit_out_of_date {
139 819f385b 2019-05-10 stsp local testroot=`test_init commit_out_of_date`
140 819f385b 2019-05-10 stsp
141 819f385b 2019-05-10 stsp got checkout $testroot/repo $testroot/wt > /dev/null
142 819f385b 2019-05-10 stsp ret="$?"
143 819f385b 2019-05-10 stsp if [ "$ret" != "0" ]; then
144 819f385b 2019-05-10 stsp test_done "$testroot" "$ret"
145 819f385b 2019-05-10 stsp return 1
146 819f385b 2019-05-10 stsp fi
147 819f385b 2019-05-10 stsp
148 819f385b 2019-05-10 stsp echo "modified alpha" > $testroot/repo/alpha
149 819f385b 2019-05-10 stsp git_commit $testroot/repo -m "modified alpha"
150 819f385b 2019-05-10 stsp
151 819f385b 2019-05-10 stsp echo "modified alpha" > $testroot/wt/alpha
152 819f385b 2019-05-10 stsp
153 819f385b 2019-05-10 stsp (cd $testroot/wt && got commit -m 'test commit_out_of_date' \
154 819f385b 2019-05-10 stsp > $testroot/stdout 2> $testroot/stderr)
155 819f385b 2019-05-10 stsp
156 819f385b 2019-05-10 stsp local head_rev=`git_show_head $testroot/repo`
157 819f385b 2019-05-10 stsp echo -n > $testroot/stdout.expected
158 819f385b 2019-05-10 stsp echo "got: work tree must be updated before these" \
159 819f385b 2019-05-10 stsp "changes can be committed" > $testroot/stderr.expected
160 819f385b 2019-05-10 stsp
161 8d301dd9 2019-05-14 stsp cmp -s $testroot/stdout.expected $testroot/stdout
162 819f385b 2019-05-10 stsp ret="$?"
163 819f385b 2019-05-10 stsp if [ "$ret" != "0" ]; then
164 819f385b 2019-05-10 stsp diff -u $testroot/stdout.expected $testroot/stdout
165 819f385b 2019-05-10 stsp test_done "$testroot" "$ret"
166 819f385b 2019-05-10 stsp return 1
167 819f385b 2019-05-10 stsp fi
168 819f385b 2019-05-10 stsp
169 8d301dd9 2019-05-14 stsp cmp -s $testroot/stderr.expected $testroot/stderr
170 819f385b 2019-05-10 stsp ret="$?"
171 819f385b 2019-05-10 stsp if [ "$ret" != "0" ]; then
172 819f385b 2019-05-10 stsp diff -u $testroot/stderr.expected $testroot/stderr
173 819f385b 2019-05-10 stsp fi
174 819f385b 2019-05-10 stsp test_done "$testroot" "$ret"
175 819f385b 2019-05-10 stsp }
176 819f385b 2019-05-10 stsp
177 8ba6ba2d 2019-05-14 stsp function test_commit_added_subdirs {
178 8ba6ba2d 2019-05-14 stsp local testroot=`test_init commit_added_subdirs`
179 8ba6ba2d 2019-05-14 stsp
180 8ba6ba2d 2019-05-14 stsp got checkout $testroot/repo $testroot/wt > /dev/null
181 8ba6ba2d 2019-05-14 stsp ret="$?"
182 8ba6ba2d 2019-05-14 stsp if [ "$ret" != "0" ]; then
183 8ba6ba2d 2019-05-14 stsp test_done "$testroot" "$ret"
184 8ba6ba2d 2019-05-14 stsp return 1
185 8ba6ba2d 2019-05-14 stsp fi
186 8ba6ba2d 2019-05-14 stsp
187 8ba6ba2d 2019-05-14 stsp mkdir -p $testroot/wt/d
188 8ba6ba2d 2019-05-14 stsp echo "new file" > $testroot/wt/d/new
189 8ba6ba2d 2019-05-14 stsp echo "new file 2" > $testroot/wt/d/new2
190 8ba6ba2d 2019-05-14 stsp mkdir -p $testroot/wt/d/f
191 8ba6ba2d 2019-05-14 stsp echo "new file 3" > $testroot/wt/d/f/new3
192 8ba6ba2d 2019-05-14 stsp mkdir -p $testroot/wt/d/f/g
193 8ba6ba2d 2019-05-14 stsp echo "new file 4" > $testroot/wt/d/f/g/new4
194 8ba6ba2d 2019-05-14 stsp
195 8ba6ba2d 2019-05-14 stsp (cd $testroot/wt && got add $testroot/wt/*/new* \
196 8ba6ba2d 2019-05-14 stsp $testroot/wt/*/*/new* $testroot/wt/*/*/*/new* > /dev/null)
197 8ba6ba2d 2019-05-14 stsp
198 8ba6ba2d 2019-05-14 stsp (cd $testroot/wt && got commit -m 'test commit_added_subdirs' \
199 8ba6ba2d 2019-05-14 stsp > $testroot/stdout 2> $testroot/stderr)
200 8ba6ba2d 2019-05-14 stsp
201 8ba6ba2d 2019-05-14 stsp local head_rev=`git_show_head $testroot/repo`
202 a3df2849 2019-05-20 stsp echo "A d/f/g/new4" > $testroot/stdout.expected
203 a3df2849 2019-05-20 stsp echo "A d/f/new3" >> $testroot/stdout.expected
204 8ba6ba2d 2019-05-14 stsp echo "A d/new" >> $testroot/stdout.expected
205 8ba6ba2d 2019-05-14 stsp echo "A d/new2" >> $testroot/stdout.expected
206 a7648d7a 2019-06-02 stsp echo "Created commit $head_rev" >> $testroot/stdout.expected
207 8ba6ba2d 2019-05-14 stsp
208 8ba6ba2d 2019-05-14 stsp cmp -s $testroot/stdout.expected $testroot/stdout
209 8ba6ba2d 2019-05-14 stsp ret="$?"
210 8ba6ba2d 2019-05-14 stsp if [ "$ret" != "0" ]; then
211 a3df2849 2019-05-20 stsp diff -u $testroot/stdout.expected $testroot/stdout
212 8ba6ba2d 2019-05-14 stsp fi
213 8ba6ba2d 2019-05-14 stsp test_done "$testroot" "$ret"
214 8ba6ba2d 2019-05-14 stsp }
215 8ba6ba2d 2019-05-14 stsp
216 f363d663 2019-05-23 stsp function test_commit_rejects_conflicted_file {
217 461aee03 2019-06-29 stsp local testroot=`test_init commit_rejects_conflicted_file`
218 f363d663 2019-05-23 stsp
219 f363d663 2019-05-23 stsp local initial_rev=`git_show_head $testroot/repo`
220 f363d663 2019-05-23 stsp
221 f363d663 2019-05-23 stsp got checkout $testroot/repo $testroot/wt > /dev/null
222 f363d663 2019-05-23 stsp ret="$?"
223 f363d663 2019-05-23 stsp if [ "$ret" != "0" ]; then
224 f363d663 2019-05-23 stsp test_done "$testroot" "$ret"
225 f363d663 2019-05-23 stsp return 1
226 f363d663 2019-05-23 stsp fi
227 f363d663 2019-05-23 stsp
228 f363d663 2019-05-23 stsp echo "modified alpha" > $testroot/wt/alpha
229 f363d663 2019-05-23 stsp (cd $testroot/wt && got commit -m "modified alpha" >/dev/null)
230 f363d663 2019-05-23 stsp
231 f363d663 2019-05-23 stsp (cd $testroot/wt && got update -c $initial_rev > /dev/null)
232 f363d663 2019-05-23 stsp
233 f363d663 2019-05-23 stsp echo "modified alpha, too" > $testroot/wt/alpha
234 f363d663 2019-05-23 stsp
235 f363d663 2019-05-23 stsp echo "C alpha" > $testroot/stdout.expected
236 f363d663 2019-05-23 stsp echo -n "Updated to commit " >> $testroot/stdout.expected
237 f363d663 2019-05-23 stsp git_show_head $testroot/repo >> $testroot/stdout.expected
238 f363d663 2019-05-23 stsp echo >> $testroot/stdout.expected
239 f363d663 2019-05-23 stsp
240 f363d663 2019-05-23 stsp (cd $testroot/wt && got update > $testroot/stdout)
241 f363d663 2019-05-23 stsp
242 f363d663 2019-05-23 stsp cmp -s $testroot/stdout.expected $testroot/stdout
243 f363d663 2019-05-23 stsp ret="$?"
244 f363d663 2019-05-23 stsp if [ "$ret" != "0" ]; then
245 f363d663 2019-05-23 stsp diff -u $testroot/stdout.expected $testroot/stdout
246 f363d663 2019-05-23 stsp test_done "$testroot" "$ret"
247 f363d663 2019-05-23 stsp return 1
248 f363d663 2019-05-23 stsp fi
249 f363d663 2019-05-23 stsp
250 f363d663 2019-05-23 stsp (cd $testroot/wt && got commit -m 'commit it' > $testroot/stdout \
251 f363d663 2019-05-23 stsp 2> $testroot/stderr)
252 f363d663 2019-05-23 stsp
253 f363d663 2019-05-23 stsp echo -n > $testroot/stdout.expected
254 f363d663 2019-05-23 stsp echo "got: cannot commit file in conflicted status" \
255 f363d663 2019-05-23 stsp > $testroot/stderr.expected
256 f363d663 2019-05-23 stsp
257 f363d663 2019-05-23 stsp cmp -s $testroot/stdout.expected $testroot/stdout
258 f363d663 2019-05-23 stsp ret="$?"
259 f363d663 2019-05-23 stsp if [ "$ret" != "0" ]; then
260 f363d663 2019-05-23 stsp diff -u $testroot/stdout.expected $testroot/stdout
261 f363d663 2019-05-23 stsp test_done "$testroot" "$ret"
262 f363d663 2019-05-23 stsp return 1
263 f363d663 2019-05-23 stsp fi
264 f363d663 2019-05-23 stsp cmp -s $testroot/stderr.expected $testroot/stderr
265 f363d663 2019-05-23 stsp ret="$?"
266 f363d663 2019-05-23 stsp if [ "$ret" != "0" ]; then
267 f363d663 2019-05-23 stsp diff -u $testroot/stderr.expected $testroot/stderr
268 f363d663 2019-05-23 stsp fi
269 f363d663 2019-05-23 stsp test_done "$testroot" "$ret"
270 f363d663 2019-05-23 stsp }
271 1a36436d 2019-06-10 stsp
272 1a36436d 2019-06-10 stsp function test_commit_single_file_multiple {
273 1a36436d 2019-06-10 stsp local testroot=`test_init commit_single_file_multiple`
274 f363d663 2019-05-23 stsp
275 1a36436d 2019-06-10 stsp got checkout $testroot/repo $testroot/wt > /dev/null
276 1a36436d 2019-06-10 stsp ret="$?"
277 1a36436d 2019-06-10 stsp if [ "$ret" != "0" ]; then
278 1a36436d 2019-06-10 stsp test_done "$testroot" "$ret"
279 1a36436d 2019-06-10 stsp return 1
280 1a36436d 2019-06-10 stsp fi
281 1a36436d 2019-06-10 stsp
282 1a36436d 2019-06-10 stsp for i in 1 2 3 4; do
283 1a36436d 2019-06-10 stsp echo "modified alpha" >> $testroot/wt/alpha
284 1a36436d 2019-06-10 stsp
285 1a36436d 2019-06-10 stsp (cd $testroot/wt && \
286 1a36436d 2019-06-10 stsp got commit -m "changed alpha" > $testroot/stdout)
287 1a36436d 2019-06-10 stsp
288 1a36436d 2019-06-10 stsp local head_rev=`git_show_head $testroot/repo`
289 1a36436d 2019-06-10 stsp echo "M alpha" > $testroot/stdout.expected
290 1a36436d 2019-06-10 stsp echo "Created commit $head_rev" >> $testroot/stdout.expected
291 1a36436d 2019-06-10 stsp
292 1a36436d 2019-06-10 stsp cmp -s $testroot/stdout.expected $testroot/stdout
293 1a36436d 2019-06-10 stsp ret="$?"
294 1a36436d 2019-06-10 stsp if [ "$ret" != "0" ]; then
295 1a36436d 2019-06-10 stsp diff -u $testroot/stdout.expected $testroot/stdout
296 1a36436d 2019-06-10 stsp test_done "$testroot" "$ret"
297 1a36436d 2019-06-10 stsp return 1
298 1a36436d 2019-06-10 stsp fi
299 1a36436d 2019-06-10 stsp done
300 1a36436d 2019-06-10 stsp
301 1a36436d 2019-06-10 stsp test_done "$testroot" "0"
302 1a36436d 2019-06-10 stsp }
303 4866d084 2019-07-10 stsp
304 4866d084 2019-07-10 stsp function test_commit_added_and_modified_in_same_dir {
305 4866d084 2019-07-10 stsp local testroot=`test_init commit_added_and_modified_in_same_dir`
306 1a36436d 2019-06-10 stsp
307 4866d084 2019-07-10 stsp got checkout $testroot/repo $testroot/wt > /dev/null
308 4866d084 2019-07-10 stsp ret="$?"
309 4866d084 2019-07-10 stsp if [ "$ret" != "0" ]; then
310 4866d084 2019-07-10 stsp test_done "$testroot" "$ret"
311 4866d084 2019-07-10 stsp return 1
312 4866d084 2019-07-10 stsp fi
313 4866d084 2019-07-10 stsp
314 4866d084 2019-07-10 stsp echo "modified zeta" > $testroot/wt/epsilon/zeta
315 4866d084 2019-07-10 stsp echo "new file" > $testroot/wt/epsilon/new
316 4866d084 2019-07-10 stsp (cd $testroot/wt && got add epsilon/new >/dev/null)
317 4866d084 2019-07-10 stsp
318 4866d084 2019-07-10 stsp (cd $testroot/wt && got commit \
319 4866d084 2019-07-10 stsp -m 'added and modified in same dir' > $testroot/stdout \
320 4866d084 2019-07-10 stsp 2> $testroot/stderr)
321 4866d084 2019-07-10 stsp
322 4866d084 2019-07-10 stsp local head_rev=`git_show_head $testroot/repo`
323 4866d084 2019-07-10 stsp echo "A epsilon/new" > $testroot/stdout.expected
324 4866d084 2019-07-10 stsp echo "M epsilon/zeta" >> $testroot/stdout.expected
325 4866d084 2019-07-10 stsp echo "Created commit $head_rev" >> $testroot/stdout.expected
326 4866d084 2019-07-10 stsp
327 4866d084 2019-07-10 stsp cmp -s $testroot/stdout.expected $testroot/stdout
328 4866d084 2019-07-10 stsp ret="$?"
329 4866d084 2019-07-10 stsp if [ "$ret" != "0" ]; then
330 2b496619 2019-07-10 stsp diff -u $testroot/stdout.expected $testroot/stdout
331 4866d084 2019-07-10 stsp fi
332 4866d084 2019-07-10 stsp test_done "$testroot" "$ret"
333 4866d084 2019-07-10 stsp }
334 4866d084 2019-07-10 stsp
335 c4296144 2019-05-09 stsp run_test test_commit_basic
336 83a7ae6d 2019-05-10 stsp run_test test_commit_new_subdir
337 83a7ae6d 2019-05-10 stsp run_test test_commit_subdir
338 83a7ae6d 2019-05-10 stsp run_test test_commit_single_file
339 83a7ae6d 2019-05-10 stsp run_test test_commit_out_of_date
340 8ba6ba2d 2019-05-14 stsp run_test test_commit_added_subdirs
341 f363d663 2019-05-23 stsp run_test test_commit_rejects_conflicted_file
342 1a36436d 2019-06-10 stsp run_test test_commit_single_file_multiple
343 4866d084 2019-07-10 stsp run_test test_commit_added_and_modified_in_same_dir