3 35dc4510 2019-02-04 stsp # Copyright (c) 2019 Stefan Sperling <stsp@openbsd.org>
5 35dc4510 2019-02-04 stsp # Permission to use, copy, modify, and distribute this software for any
6 35dc4510 2019-02-04 stsp # purpose with or without fee is hereby granted, provided that the above
7 35dc4510 2019-02-04 stsp # copyright notice and this permission notice appear in all copies.
9 35dc4510 2019-02-04 stsp # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 35dc4510 2019-02-04 stsp # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 35dc4510 2019-02-04 stsp # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 35dc4510 2019-02-04 stsp # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 35dc4510 2019-02-04 stsp # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 35dc4510 2019-02-04 stsp # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 35dc4510 2019-02-04 stsp # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 35dc4510 2019-02-04 stsp . ./common.sh
19 f6cae3ed 2020-09-13 naddy test_status_basic() {
20 35dc4510 2019-02-04 stsp local testroot=`test_init status_basic`
22 35dc4510 2019-02-04 stsp got checkout $testroot/repo $testroot/wt > /dev/null
24 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
25 e60e7f5b 2019-02-10 stsp test_done "$testroot" "$ret"
29 35dc4510 2019-02-04 stsp echo "modified alpha" > $testroot/wt/alpha
30 2ec1f75b 2019-03-26 stsp (cd $testroot/wt && got rm beta >/dev/null)
31 35dc4510 2019-02-04 stsp echo "unversioned file" > $testroot/wt/foo
32 35dc4510 2019-02-04 stsp rm $testroot/wt/epsilon/zeta
33 14e5d4dc 2019-02-05 stsp touch $testroot/wt/beta
34 d00136be 2019-03-26 stsp echo "new file" > $testroot/wt/new
35 d00136be 2019-03-26 stsp (cd $testroot/wt && got add new >/dev/null)
36 40b289d7 2019-09-07 stsp mkdir -m 0000 $testroot/wt/bar
38 35dc4510 2019-02-04 stsp echo 'M alpha' > $testroot/stdout.expected
39 2ec1f75b 2019-03-26 stsp echo 'D beta' >> $testroot/stdout.expected
40 35dc4510 2019-02-04 stsp echo '! epsilon/zeta' >> $testroot/stdout.expected
41 35dc4510 2019-02-04 stsp echo '? foo' >> $testroot/stdout.expected
42 d00136be 2019-03-26 stsp echo 'A new' >> $testroot/stdout.expected
44 35dc4510 2019-02-04 stsp (cd $testroot/wt && got status > $testroot/stdout)
46 8d301dd9 2019-05-14 stsp cmp -s $testroot/stdout.expected $testroot/stdout
48 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
49 35dc4510 2019-02-04 stsp diff -u $testroot/stdout.expected $testroot/stdout
51 40b289d7 2019-09-07 stsp chmod 700 $testroot/wt/bar
52 40b289d7 2019-09-07 stsp rmdir $testroot/wt/bar
53 e60e7f5b 2019-02-10 stsp test_done "$testroot" "$ret"
56 f6cae3ed 2020-09-13 naddy test_status_subdir_no_mods() {
57 f02ba292 2019-02-05 stsp local testroot=`test_init status_subdir_no_mods 1`
59 f02ba292 2019-02-05 stsp mkdir $testroot/repo/Basic/
60 f02ba292 2019-02-05 stsp mkdir $testroot/repo/Basic/Targets/
61 f02ba292 2019-02-05 stsp touch $testroot/repo/Basic/Targets/AArch64.cpp
62 f02ba292 2019-02-05 stsp touch $testroot/repo/Basic/Targets.cpp
63 f02ba292 2019-02-05 stsp touch $testroot/repo/Basic/Targets.h
64 f02ba292 2019-02-05 stsp (cd $testroot/repo && git add .)
65 f02ba292 2019-02-05 stsp git_commit $testroot/repo -m "add subdir with files"
67 f02ba292 2019-02-05 stsp got checkout $testroot/repo $testroot/wt > /dev/null
69 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
70 e60e7f5b 2019-02-10 stsp test_done "$testroot" "$ret"
74 f02ba292 2019-02-05 stsp touch $testroot/stdout.expected
76 f02ba292 2019-02-05 stsp # This used to erroneously print:
78 f02ba292 2019-02-05 stsp # ! Basic/Targets.cpp
79 f02ba292 2019-02-05 stsp # ? Basic/Targets.cpp
80 f02ba292 2019-02-05 stsp (cd $testroot/wt && got status > $testroot/stdout)
82 8d301dd9 2019-05-14 stsp cmp -s $testroot/stdout.expected $testroot/stdout
84 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
85 f02ba292 2019-02-05 stsp diff -u $testroot/stdout.expected $testroot/stdout
87 e60e7f5b 2019-02-10 stsp test_done "$testroot" "$ret"
90 f6cae3ed 2020-09-13 naddy test_status_subdir_no_mods2() {
91 f02ba292 2019-02-05 stsp local testroot=`test_init status_subdir_no_mods2 1`
93 f02ba292 2019-02-05 stsp mkdir $testroot/repo/AST
94 f02ba292 2019-02-05 stsp touch $testroot/repo/AST/APValue.cpp
95 f02ba292 2019-02-05 stsp mkdir $testroot/repo/ASTMatchers
96 f02ba292 2019-02-05 stsp touch $testroot/repo/ASTMatchers/ASTMatchFinder.cpp
97 f02ba292 2019-02-05 stsp mkdir $testroot/repo/Frontend
98 f02ba292 2019-02-05 stsp touch $testroot/repo/Frontend/ASTConsumers.cpp
99 f02ba292 2019-02-05 stsp mkdir $testroot/repo/Frontend/Rewrite
100 f02ba292 2019-02-05 stsp touch $testroot/repo/Frontend/Rewrite/CMakeLists.txt
101 f02ba292 2019-02-05 stsp mkdir $testroot/repo/FrontendTool
102 f02ba292 2019-02-05 stsp touch $testroot/repo/FrontendTool/CMakeLists.txt
103 f02ba292 2019-02-05 stsp touch $testroot/repo/FrontendTool/ExecuteCompilerInvocation.cpp
104 f02ba292 2019-02-05 stsp (cd $testroot/repo && git add .)
105 f02ba292 2019-02-05 stsp git_commit $testroot/repo -m "add subdir with files"
107 f02ba292 2019-02-05 stsp got checkout $testroot/repo $testroot/wt > /dev/null
109 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
110 e60e7f5b 2019-02-10 stsp test_done "$testroot" "$ret"
114 f02ba292 2019-02-05 stsp touch $testroot/stdout.expected
116 f02ba292 2019-02-05 stsp # This used to erroneously print:
118 f02ba292 2019-02-05 stsp # ! AST/APValue.cpp
119 f02ba292 2019-02-05 stsp # ? AST/APValue.cpp
120 f02ba292 2019-02-05 stsp # ! Frontend/ASTConsumers.cpp
121 f02ba292 2019-02-05 stsp # ! Frontend/Rewrite/CMakeLists.txt
122 f02ba292 2019-02-05 stsp # ? Frontend/ASTConsumers.cpp
123 f02ba292 2019-02-05 stsp # ? Frontend/Rewrite/CMakeLists.txt
124 f02ba292 2019-02-05 stsp (cd $testroot/wt && got status > $testroot/stdout)
126 8d301dd9 2019-05-14 stsp cmp -s $testroot/stdout.expected $testroot/stdout
128 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
129 f02ba292 2019-02-05 stsp diff -u $testroot/stdout.expected $testroot/stdout
131 e60e7f5b 2019-02-10 stsp test_done "$testroot" "$ret"
134 f6cae3ed 2020-09-13 naddy test_status_obstructed() {
135 0dbc2271 2019-02-05 stsp local testroot=`test_init status_obstructed`
137 0dbc2271 2019-02-05 stsp got checkout $testroot/repo $testroot/wt > /dev/null
139 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
140 e60e7f5b 2019-02-10 stsp test_done "$testroot" "$ret"
144 0dbc2271 2019-02-05 stsp rm $testroot/wt/epsilon/zeta
145 0dbc2271 2019-02-05 stsp mkdir $testroot/wt/epsilon/zeta
147 0dbc2271 2019-02-05 stsp echo '~ epsilon/zeta' > $testroot/stdout.expected
149 0dbc2271 2019-02-05 stsp (cd $testroot/wt && got status > $testroot/stdout)
151 a78810f8 2022-03-13 thomas cmp -s $testroot/stdout.expected $testroot/stdout
153 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
154 a78810f8 2022-03-13 thomas diff -u $testroot/stdout.expected $testroot/stdout
155 a78810f8 2022-03-13 thomas test_done "$testroot" "$ret"
159 a78810f8 2022-03-13 thomas (cd $testroot/wt && got status epsilon/zeta > $testroot/stdout)
161 8d301dd9 2019-05-14 stsp cmp -s $testroot/stdout.expected $testroot/stdout
163 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
164 0dbc2271 2019-02-05 stsp diff -u $testroot/stdout.expected $testroot/stdout
166 e60e7f5b 2019-02-10 stsp test_done "$testroot" "$ret"
169 f6cae3ed 2020-09-13 naddy test_status_shows_local_mods_after_update() {
170 02c07007 2019-02-10 stsp local testroot=`test_init status_shows_local_mods_after_update 1`
172 02c07007 2019-02-10 stsp echo "1" > $testroot/repo/numbers
173 02c07007 2019-02-10 stsp echo "2" >> $testroot/repo/numbers
174 02c07007 2019-02-10 stsp echo "3" >> $testroot/repo/numbers
175 02c07007 2019-02-10 stsp echo "4" >> $testroot/repo/numbers
176 02c07007 2019-02-10 stsp echo "5" >> $testroot/repo/numbers
177 02c07007 2019-02-10 stsp echo "6" >> $testroot/repo/numbers
178 02c07007 2019-02-10 stsp echo "7" >> $testroot/repo/numbers
179 02c07007 2019-02-10 stsp echo "8" >> $testroot/repo/numbers
180 02c07007 2019-02-10 stsp (cd $testroot/repo && git add numbers)
181 02c07007 2019-02-10 stsp git_commit $testroot/repo -m "added numbers file"
183 02c07007 2019-02-10 stsp got checkout $testroot/repo $testroot/wt > /dev/null
185 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
186 02c07007 2019-02-10 stsp test_done "$testroot" "$ret"
190 ac3cdf31 2023-03-06 thomas ed -s $testroot/repo/numbers <<-\EOF
194 02c07007 2019-02-10 stsp git_commit $testroot/repo -m "modified line 2"
196 02c07007 2019-02-10 stsp # modify line 7; both changes should merge cleanly
197 ac3cdf31 2023-03-06 thomas ed -s $testroot/wt/numbers <<-\EOF
202 02c07007 2019-02-10 stsp echo "G numbers" > $testroot/stdout.expected
203 4f3c844b 2021-09-14 stsp echo -n "Updated to refs/heads/master: " >> $testroot/stdout.expected
204 02c07007 2019-02-10 stsp git_show_head $testroot/repo >> $testroot/stdout.expected
205 02c07007 2019-02-10 stsp echo >> $testroot/stdout.expected
207 02c07007 2019-02-10 stsp (cd $testroot/wt && got update > $testroot/stdout)
209 8d301dd9 2019-05-14 stsp cmp -s $testroot/stdout.expected $testroot/stdout
211 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
212 02c07007 2019-02-10 stsp diff -u $testroot/stdout.expected $testroot/stdout
213 02c07007 2019-02-10 stsp test_done "$testroot" "$ret"
217 02c07007 2019-02-10 stsp echo 'M numbers' > $testroot/stdout.expected
219 02c07007 2019-02-10 stsp (cd $testroot/wt && got status > $testroot/stdout)
221 8d301dd9 2019-05-14 stsp cmp -s $testroot/stdout.expected $testroot/stdout
223 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
224 02c07007 2019-02-10 stsp diff -u $testroot/stdout.expected $testroot/stdout
226 e60e7f5b 2019-02-10 stsp test_done "$testroot" "$ret"
229 f6cae3ed 2020-09-13 naddy test_status_unversioned_subdirs() {
230 18831e78 2019-02-10 stsp local testroot=`test_init status_unversioned_subdirs 1`
232 18831e78 2019-02-10 stsp mkdir $testroot/repo/cdfs/
233 18831e78 2019-02-10 stsp touch $testroot/repo/cdfs/Makefile
234 18831e78 2019-02-10 stsp mkdir $testroot/repo/common/
235 18831e78 2019-02-10 stsp touch $testroot/repo/common/Makefile
236 18831e78 2019-02-10 stsp mkdir $testroot/repo/iso/
237 18831e78 2019-02-10 stsp touch $testroot/repo/iso/Makefile
238 18831e78 2019-02-10 stsp mkdir $testroot/repo/ramdisk/
239 18831e78 2019-02-10 stsp touch $testroot/repo/ramdisk/Makefile
240 18831e78 2019-02-10 stsp touch $testroot/repo/ramdisk/list.local
241 18831e78 2019-02-10 stsp mkdir $testroot/repo/ramdisk_cd/
242 18831e78 2019-02-10 stsp touch $testroot/repo/ramdisk_cd/Makefile
243 18831e78 2019-02-10 stsp touch $testroot/repo/ramdisk_cd/list.local
244 18831e78 2019-02-10 stsp (cd $testroot/repo && git add .)
245 18831e78 2019-02-10 stsp git_commit $testroot/repo -m "first commit"
247 18831e78 2019-02-10 stsp got checkout $testroot/repo $testroot/wt > /dev/null
249 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
250 18831e78 2019-02-10 stsp test_done "$testroot" "$ret"
254 18831e78 2019-02-10 stsp mkdir $testroot/wt/cdfs/obj
255 18831e78 2019-02-10 stsp mkdir $testroot/wt/ramdisk/obj
256 18831e78 2019-02-10 stsp mkdir $testroot/wt/ramdisk_cd/obj
257 18831e78 2019-02-10 stsp mkdir $testroot/wt/iso/obj
259 18831e78 2019-02-10 stsp echo -n > $testroot/stdout.expected
261 18831e78 2019-02-10 stsp # This used to erroneously print:
263 18831e78 2019-02-10 stsp # ! ramdisk_cd/Makefile
264 18831e78 2019-02-10 stsp # ! ramdisk_cd/list.local
265 18831e78 2019-02-10 stsp # ? ramdisk_cd/Makefile
266 18831e78 2019-02-10 stsp # ? ramdisk_cd/list.local
267 18831e78 2019-02-10 stsp (cd $testroot/wt && got status > $testroot/stdout)
269 8d301dd9 2019-05-14 stsp cmp -s $testroot/stdout.expected $testroot/stdout
271 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
272 18831e78 2019-02-10 stsp diff -u $testroot/stdout.expected $testroot/stdout
274 18831e78 2019-02-10 stsp test_done "$testroot" "$ret"
277 f6cae3ed 2020-09-13 naddy test_status_symlink() {
278 00bb5ea0 2020-07-23 stsp local testroot=`test_init status_symlink`
280 2c201a36 2019-02-10 stsp mkdir $testroot/repo/ramdisk/
281 2c201a36 2019-02-10 stsp touch $testroot/repo/ramdisk/Makefile
282 d4ae64fa 2020-07-23 stsp (cd $testroot/repo && ln -s alpha alpha.link)
283 d4ae64fa 2020-07-23 stsp (cd $testroot/repo && ln -s epsilon epsilon.link)
284 d4ae64fa 2020-07-23 stsp (cd $testroot/repo && ln -s nonexistent nonexistent.link)
285 2c201a36 2019-02-10 stsp (cd $testroot/repo && git add .)
286 2c201a36 2019-02-10 stsp git_commit $testroot/repo -m "first commit"
288 2c201a36 2019-02-10 stsp got checkout $testroot/repo $testroot/wt > /dev/null
290 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
291 2c201a36 2019-02-10 stsp test_done "$testroot" "$ret"
295 2c201a36 2019-02-10 stsp ln -s /usr/obj/distrib/i386/ramdisk $testroot/wt/ramdisk/obj
297 00bb5ea0 2020-07-23 stsp echo "? ramdisk/obj" > $testroot/stdout.expected
299 00bb5ea0 2020-07-23 stsp (cd $testroot/wt && got status > $testroot/stdout)
301 00bb5ea0 2020-07-23 stsp cmp -s $testroot/stdout.expected $testroot/stdout
303 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
304 00bb5ea0 2020-07-23 stsp diff -u $testroot/stdout.expected $testroot/stdout
305 00bb5ea0 2020-07-23 stsp test_done "$testroot" "$ret"
309 d4ae64fa 2020-07-23 stsp (cd $testroot/wt && ln -sf beta alpha.link)
310 e6f45b72 2023-03-03 thomas (cd $testroot/wt && rm epsilon.link && ln -s gamma epsilon.link)
312 00bb5ea0 2020-07-23 stsp (cd $testroot/wt && ln -s /etc/passwd passwd.link)
313 00bb5ea0 2020-07-23 stsp (cd $testroot/wt && ln -s ../beta epsilon/beta.link)
314 d4ae64fa 2020-07-23 stsp (cd $testroot/wt && got add passwd.link epsilon/beta.link > /dev/null)
316 d4ae64fa 2020-07-23 stsp (cd $testroot/wt && got rm nonexistent.link > /dev/null)
318 d4ae64fa 2020-07-23 stsp echo 'M alpha.link' > $testroot/stdout.expected
319 00bb5ea0 2020-07-23 stsp echo 'A epsilon/beta.link' >> $testroot/stdout.expected
320 d4ae64fa 2020-07-23 stsp echo 'M epsilon.link' >> $testroot/stdout.expected
321 d4ae64fa 2020-07-23 stsp echo 'D nonexistent.link' >> $testroot/stdout.expected
322 00bb5ea0 2020-07-23 stsp echo 'A passwd.link' >> $testroot/stdout.expected
323 00bb5ea0 2020-07-23 stsp echo "? ramdisk/obj" >> $testroot/stdout.expected
325 3cbbd752 2019-02-19 stsp (cd $testroot/wt && got status > $testroot/stdout)
327 8d301dd9 2019-05-14 stsp cmp -s $testroot/stdout.expected $testroot/stdout
329 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
330 3cbbd752 2019-02-19 stsp diff -u $testroot/stdout.expected $testroot/stdout
332 3cbbd752 2019-02-19 stsp test_done "$testroot" "$ret"
335 f6cae3ed 2020-09-13 naddy test_status_shows_no_mods_after_complete_merge() {
336 3cbbd752 2019-02-19 stsp local testroot=`test_init status_shows_no_mods_after_complete_merge 1`
338 3cbbd752 2019-02-19 stsp # make this file larger than the usual blob buffer size of 8192
339 342fc2e7 2022-04-16 thomas jot 16384 > $testroot/repo/numbers
341 3cbbd752 2019-02-19 stsp (cd $testroot/repo && git add numbers)
342 3cbbd752 2019-02-19 stsp git_commit $testroot/repo -m "added numbers file"
344 3cbbd752 2019-02-19 stsp got checkout $testroot/repo $testroot/wt > /dev/null
346 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
347 3cbbd752 2019-02-19 stsp test_done "$testroot" "$ret"
351 ac3cdf31 2023-03-06 thomas ed -s $testroot/repo/numbers <<-\EOF
355 3cbbd752 2019-02-19 stsp git_commit $testroot/repo -m "modified line 2"
357 3cbbd752 2019-02-19 stsp # modify line 2 again; no local changes are left after merge
358 ac3cdf31 2023-03-06 thomas ed -s $testroot/wt/numbers <<-\EOF
363 3cbbd752 2019-02-19 stsp echo "G numbers" > $testroot/stdout.expected
364 4f3c844b 2021-09-14 stsp echo -n "Updated to refs/heads/master: " >> $testroot/stdout.expected
365 3cbbd752 2019-02-19 stsp git_show_head $testroot/repo >> $testroot/stdout.expected
366 3cbbd752 2019-02-19 stsp echo >> $testroot/stdout.expected
368 3cbbd752 2019-02-19 stsp (cd $testroot/wt && got update > $testroot/stdout)
370 8d301dd9 2019-05-14 stsp cmp -s $testroot/stdout.expected $testroot/stdout
372 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
373 3cbbd752 2019-02-19 stsp diff -u $testroot/stdout.expected $testroot/stdout
374 3cbbd752 2019-02-19 stsp test_done "$testroot" "$ret"
378 2c201a36 2019-02-10 stsp echo -n > $testroot/stdout.expected
380 2c201a36 2019-02-10 stsp (cd $testroot/wt && got status > $testroot/stdout)
382 8d301dd9 2019-05-14 stsp cmp -s $testroot/stdout.expected $testroot/stdout
384 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
385 2c201a36 2019-02-10 stsp diff -u $testroot/stdout.expected $testroot/stdout
387 2c201a36 2019-02-10 stsp test_done "$testroot" "$ret"
390 f6cae3ed 2020-09-13 naddy test_status_shows_conflict() {
391 7154f6ce 2019-03-27 stsp local testroot=`test_init status_shows_conflict 1`
393 7154f6ce 2019-03-27 stsp echo "1" > $testroot/repo/numbers
394 7154f6ce 2019-03-27 stsp echo "2" >> $testroot/repo/numbers
395 7154f6ce 2019-03-27 stsp echo "3" >> $testroot/repo/numbers
396 7154f6ce 2019-03-27 stsp echo "4" >> $testroot/repo/numbers
397 7154f6ce 2019-03-27 stsp echo "5" >> $testroot/repo/numbers
398 7154f6ce 2019-03-27 stsp echo "6" >> $testroot/repo/numbers
399 7154f6ce 2019-03-27 stsp echo "7" >> $testroot/repo/numbers
400 7154f6ce 2019-03-27 stsp echo "8" >> $testroot/repo/numbers
401 7154f6ce 2019-03-27 stsp (cd $testroot/repo && git add numbers)
402 7154f6ce 2019-03-27 stsp git_commit $testroot/repo -m "added numbers file"
404 7154f6ce 2019-03-27 stsp got checkout $testroot/repo $testroot/wt > /dev/null
406 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
407 7154f6ce 2019-03-27 stsp test_done "$testroot" "$ret"
411 ac3cdf31 2023-03-06 thomas ed -s $testroot/repo/numbers <<-\EOF
415 7154f6ce 2019-03-27 stsp git_commit $testroot/repo -m "modified line 2"
417 7154f6ce 2019-03-27 stsp # modify line 2 in a conflicting way
418 ac3cdf31 2023-03-06 thomas ed -s $testroot/wt/numbers <<-\EOF
423 7154f6ce 2019-03-27 stsp echo "C numbers" > $testroot/stdout.expected
424 4f3c844b 2021-09-14 stsp echo -n "Updated to refs/heads/master: " >> $testroot/stdout.expected
425 7154f6ce 2019-03-27 stsp git_show_head $testroot/repo >> $testroot/stdout.expected
426 7154f6ce 2019-03-27 stsp echo >> $testroot/stdout.expected
427 9627c110 2020-04-18 stsp echo "Files with new merge conflicts: 1" >> $testroot/stdout.expected
429 7154f6ce 2019-03-27 stsp (cd $testroot/wt && got update > $testroot/stdout)
431 8d301dd9 2019-05-14 stsp cmp -s $testroot/stdout.expected $testroot/stdout
433 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
434 7154f6ce 2019-03-27 stsp diff -u $testroot/stdout.expected $testroot/stdout
435 7154f6ce 2019-03-27 stsp test_done "$testroot" "$ret"
439 7154f6ce 2019-03-27 stsp echo 'C numbers' > $testroot/stdout.expected
441 7154f6ce 2019-03-27 stsp (cd $testroot/wt && got status > $testroot/stdout)
443 c577a9ce 2019-07-27 stsp cmp -s $testroot/stdout.expected $testroot/stdout
445 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
446 c577a9ce 2019-07-27 stsp diff -u $testroot/stdout.expected $testroot/stdout
448 c577a9ce 2019-07-27 stsp test_done "$testroot" "$ret"
451 f6cae3ed 2020-09-13 naddy test_status_empty_dir() {
452 c577a9ce 2019-07-27 stsp local testroot=`test_init status_empty_dir`
454 c577a9ce 2019-07-27 stsp got checkout $testroot/repo $testroot/wt > /dev/null
456 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
457 c577a9ce 2019-07-27 stsp test_done "$testroot" "$ret"
461 c577a9ce 2019-07-27 stsp rm $testroot/wt/epsilon/zeta
463 c577a9ce 2019-07-27 stsp echo '! epsilon/zeta' > $testroot/stdout.expected
465 c577a9ce 2019-07-27 stsp (cd $testroot/wt && got status epsilon > $testroot/stdout)
467 c577a9ce 2019-07-27 stsp cmp -s $testroot/stdout.expected $testroot/stdout
469 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
470 c577a9ce 2019-07-27 stsp diff -u $testroot/stdout.expected $testroot/stdout
472 c577a9ce 2019-07-27 stsp test_done "$testroot" "$ret"
475 f6cae3ed 2020-09-13 naddy test_status_empty_dir_unversioned_file() {
476 c577a9ce 2019-07-27 stsp local testroot=`test_init status_empty_dir_unversioned_file`
478 c577a9ce 2019-07-27 stsp got checkout $testroot/repo $testroot/wt > /dev/null
480 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
481 c577a9ce 2019-07-27 stsp test_done "$testroot" "$ret"
485 c577a9ce 2019-07-27 stsp rm $testroot/wt/epsilon/zeta
486 c577a9ce 2019-07-27 stsp touch $testroot/wt/epsilon/unversioned
488 c577a9ce 2019-07-27 stsp echo '? epsilon/unversioned' > $testroot/stdout.expected
489 c577a9ce 2019-07-27 stsp echo '! epsilon/zeta' >> $testroot/stdout.expected
491 c577a9ce 2019-07-27 stsp (cd $testroot/wt && got status epsilon > $testroot/stdout)
493 8d301dd9 2019-05-14 stsp cmp -s $testroot/stdout.expected $testroot/stdout
495 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
496 7154f6ce 2019-03-27 stsp diff -u $testroot/stdout.expected $testroot/stdout
498 7154f6ce 2019-03-27 stsp test_done "$testroot" "$ret"
501 f6cae3ed 2020-09-13 naddy test_status_many_paths() {
502 72ea6654 2019-07-27 stsp local testroot=`test_init status_many_paths`
504 72ea6654 2019-07-27 stsp got checkout $testroot/repo $testroot/wt > /dev/null
506 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
507 72ea6654 2019-07-27 stsp test_done "$testroot" "$ret"
511 72ea6654 2019-07-27 stsp echo "modified alpha" > $testroot/wt/alpha
512 72ea6654 2019-07-27 stsp (cd $testroot/wt && got rm beta >/dev/null)
513 72ea6654 2019-07-27 stsp echo "unversioned file" > $testroot/wt/foo
514 72ea6654 2019-07-27 stsp rm $testroot/wt/epsilon/zeta
515 72ea6654 2019-07-27 stsp touch $testroot/wt/beta
516 72ea6654 2019-07-27 stsp echo "new file" > $testroot/wt/new
517 72ea6654 2019-07-27 stsp mkdir $testroot/wt/newdir
518 72ea6654 2019-07-27 stsp (cd $testroot/wt && got add new >/dev/null)
520 f1417e9f 2021-10-12 thomas (cd $testroot/wt && got status alpha > $testroot/stdout.expected)
521 f1417e9f 2021-10-12 thomas (cd $testroot/wt && got status beta >> $testroot/stdout.expected)
522 72ea6654 2019-07-27 stsp (cd $testroot/wt && got status epsilon >> $testroot/stdout.expected)
523 72ea6654 2019-07-27 stsp (cd $testroot/wt && got status foo >> $testroot/stdout.expected)
524 72ea6654 2019-07-27 stsp (cd $testroot/wt && got status new >> $testroot/stdout.expected)
525 f1417e9f 2021-10-12 thomas (cd $testroot/wt && got status newdir >> $testroot/stdout.expected)
526 72ea6654 2019-07-27 stsp (cd $testroot/wt && got status . >> $testroot/stdout.expected)
528 72ea6654 2019-07-27 stsp (cd $testroot/wt && got status newdir alpha epsilon foo new beta . \
529 72ea6654 2019-07-27 stsp > $testroot/stdout)
531 6841da00 2019-08-08 stsp cmp -s $testroot/stdout.expected $testroot/stdout
533 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
534 6841da00 2019-08-08 stsp diff -u $testroot/stdout.expected $testroot/stdout
536 6841da00 2019-08-08 stsp test_done "$testroot" "$ret"
539 f6cae3ed 2020-09-13 naddy test_status_cvsignore() {
540 6841da00 2019-08-08 stsp local testroot=`test_init status_cvsignore`
542 6841da00 2019-08-08 stsp got checkout $testroot/repo $testroot/wt > /dev/null
544 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
545 6841da00 2019-08-08 stsp test_done "$testroot" "$ret"
549 6841da00 2019-08-08 stsp echo "unversioned file" > $testroot/wt/foo
550 6841da00 2019-08-08 stsp echo "unversioned file" > $testroot/wt/foop
551 3143d852 2020-06-25 stsp echo "unversioned file" > $testroot/wt/epsilon/foo
552 6841da00 2019-08-08 stsp echo "unversioned file" > $testroot/wt/epsilon/bar
553 6841da00 2019-08-08 stsp echo "unversioned file" > $testroot/wt/epsilon/boo
554 6841da00 2019-08-08 stsp echo "unversioned file" > $testroot/wt/epsilon/moo
555 3143d852 2020-06-25 stsp mkdir -p $testroot/wt/epsilon/new/
556 3143d852 2020-06-25 stsp echo "unversioned file" > $testroot/wt/epsilon/new/foo
557 3143d852 2020-06-25 stsp echo "**/foo" > $testroot/wt/.cvsignore
558 8528beef 2021-10-15 thomas echo "**/gamma" >> $testroot/wt/.cvsignore
559 6841da00 2019-08-08 stsp echo "bar" > $testroot/wt/epsilon/.cvsignore
560 6841da00 2019-08-08 stsp echo "moo" >> $testroot/wt/epsilon/.cvsignore
562 6841da00 2019-08-08 stsp echo '? .cvsignore' > $testroot/stdout.expected
563 6841da00 2019-08-08 stsp echo '? epsilon/.cvsignore' >> $testroot/stdout.expected
564 6841da00 2019-08-08 stsp echo '? epsilon/boo' >> $testroot/stdout.expected
565 6841da00 2019-08-08 stsp echo '? foop' >> $testroot/stdout.expected
566 6841da00 2019-08-08 stsp (cd $testroot/wt && got status > $testroot/stdout)
568 3143d852 2020-06-25 stsp cmp -s $testroot/stdout.expected $testroot/stdout
570 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
571 3143d852 2020-06-25 stsp diff -u $testroot/stdout.expected $testroot/stdout
572 3143d852 2020-06-25 stsp test_done "$testroot" "$ret"
576 3143d852 2020-06-25 stsp echo '? epsilon/.cvsignore' > $testroot/stdout.expected
577 3143d852 2020-06-25 stsp echo '? epsilon/boo' >> $testroot/stdout.expected
578 3143d852 2020-06-25 stsp (cd $testroot/wt && got status epsilon > $testroot/stdout)
580 b80270a7 2019-08-08 stsp cmp -s $testroot/stdout.expected $testroot/stdout
582 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
583 b80270a7 2019-08-08 stsp diff -u $testroot/stdout.expected $testroot/stdout
584 b80270a7 2019-08-08 stsp test_done "$testroot" "$ret"
588 3143d852 2020-06-25 stsp echo -n '' > $testroot/stdout.expected
589 3143d852 2020-06-25 stsp (cd $testroot/wt && got status epsilon/new > $testroot/stdout)
591 3143d852 2020-06-25 stsp cmp -s $testroot/stdout.expected $testroot/stdout
593 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
594 3143d852 2020-06-25 stsp diff -u $testroot/stdout.expected $testroot/stdout
595 3143d852 2020-06-25 stsp test_done "$testroot" "$ret"
599 b80270a7 2019-08-08 stsp echo '? .cvsignore' > $testroot/stdout.expected
600 b80270a7 2019-08-08 stsp echo '? epsilon/.cvsignore' >> $testroot/stdout.expected
601 b80270a7 2019-08-08 stsp echo '? epsilon/boo' >> $testroot/stdout.expected
602 bd8de430 2019-10-04 stsp echo '? foop' >> $testroot/stdout.expected
603 bd8de430 2019-10-04 stsp (cd $testroot/wt/gamma && got status > $testroot/stdout)
605 f6343036 2021-06-22 stsp cmp -s $testroot/stdout.expected $testroot/stdout
607 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
608 f6343036 2021-06-22 stsp diff -u $testroot/stdout.expected $testroot/stdout
609 f6343036 2021-06-22 stsp test_done "$testroot" "$ret"
613 f6343036 2021-06-22 stsp cat > $testroot/stdout.expected <<EOF
614 f6343036 2021-06-22 stsp ? .cvsignore
615 f6343036 2021-06-22 stsp ? epsilon/.cvsignore
616 f6343036 2021-06-22 stsp ? epsilon/bar
617 f6343036 2021-06-22 stsp ? epsilon/boo
618 f6343036 2021-06-22 stsp ? epsilon/foo
619 f6343036 2021-06-22 stsp ? epsilon/moo
620 f6343036 2021-06-22 stsp ? epsilon/new/foo
624 f6343036 2021-06-22 stsp (cd $testroot/wt && got status -I > $testroot/stdout)
626 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
627 f6343036 2021-06-22 stsp echo "got status failed unexpectedly" >&2
628 f6343036 2021-06-22 stsp test_done "$testroot" "1"
632 bd8de430 2019-10-04 stsp cmp -s $testroot/stdout.expected $testroot/stdout
634 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
635 bd8de430 2019-10-04 stsp diff -u $testroot/stdout.expected $testroot/stdout
637 bd8de430 2019-10-04 stsp test_done "$testroot" "$ret"
640 f6cae3ed 2020-09-13 naddy test_status_gitignore() {
641 bd8de430 2019-10-04 stsp local testroot=`test_init status_gitignore`
643 bd8de430 2019-10-04 stsp got checkout $testroot/repo $testroot/wt > /dev/null
645 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
646 bd8de430 2019-10-04 stsp test_done "$testroot" "$ret"
650 bd8de430 2019-10-04 stsp echo "unversioned file" > $testroot/wt/foo
651 bd8de430 2019-10-04 stsp echo "unversioned file" > $testroot/wt/foop
652 bd8de430 2019-10-04 stsp echo "unversioned file" > $testroot/wt/barp
653 bd8de430 2019-10-04 stsp echo "unversioned file" > $testroot/wt/epsilon/bar
654 bd8de430 2019-10-04 stsp echo "unversioned file" > $testroot/wt/epsilon/boo
655 bd8de430 2019-10-04 stsp echo "unversioned file" > $testroot/wt/epsilon/moo
656 bd8de430 2019-10-04 stsp mkdir -p $testroot/wt/a/b/c/
657 bd8de430 2019-10-04 stsp echo "unversioned file" > $testroot/wt/a/b/c/foo
658 bd8de430 2019-10-04 stsp echo "unversioned file" > $testroot/wt/a/b/c/zoo
659 bd8de430 2019-10-04 stsp echo "foo" > $testroot/wt/.gitignore
660 bd8de430 2019-10-04 stsp echo "bar*" >> $testroot/wt/.gitignore
661 bd8de430 2019-10-04 stsp echo "epsilon/**" >> $testroot/wt/.gitignore
662 bd8de430 2019-10-04 stsp echo "a/**/foo" >> $testroot/wt/.gitignore
663 bd8de430 2019-10-04 stsp echo "**/zoo" >> $testroot/wt/.gitignore
665 bd8de430 2019-10-04 stsp echo '? .gitignore' > $testroot/stdout.expected
666 b80270a7 2019-08-08 stsp echo '? foop' >> $testroot/stdout.expected
667 bd8de430 2019-10-04 stsp (cd $testroot/wt && got status > $testroot/stdout)
669 bd8de430 2019-10-04 stsp cmp -s $testroot/stdout.expected $testroot/stdout
671 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
672 bd8de430 2019-10-04 stsp diff -u $testroot/stdout.expected $testroot/stdout
673 bd8de430 2019-10-04 stsp test_done "$testroot" "$ret"
677 bd8de430 2019-10-04 stsp echo '? .gitignore' > $testroot/stdout.expected
678 bd8de430 2019-10-04 stsp echo '? foop' >> $testroot/stdout.expected
679 b80270a7 2019-08-08 stsp (cd $testroot/wt/gamma && got status > $testroot/stdout)
681 72ea6654 2019-07-27 stsp cmp -s $testroot/stdout.expected $testroot/stdout
683 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
684 72ea6654 2019-07-27 stsp diff -u $testroot/stdout.expected $testroot/stdout
685 f6343036 2021-06-22 stsp test_done "$testroot" "$ret"
689 f6343036 2021-06-22 stsp cat > $testroot/stdout.expected <<EOF
690 f6343036 2021-06-22 stsp ? .gitignore
691 f6343036 2021-06-22 stsp ? a/b/c/foo
692 f6343036 2021-06-22 stsp ? a/b/c/zoo
694 f6343036 2021-06-22 stsp ? epsilon/bar
695 f6343036 2021-06-22 stsp ? epsilon/boo
696 f6343036 2021-06-22 stsp ? epsilon/moo
700 f6343036 2021-06-22 stsp (cd $testroot/wt && got status -I > $testroot/stdout)
702 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
703 f6343036 2021-06-22 stsp echo "got status failed unexpectedly" >&2
704 f6343036 2021-06-22 stsp test_done "$testroot" "1"
708 f6343036 2021-06-22 stsp cmp -s $testroot/stdout.expected $testroot/stdout
710 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
711 f6343036 2021-06-22 stsp diff -u $testroot/stdout.expected $testroot/stdout
713 72ea6654 2019-07-27 stsp test_done "$testroot" "$ret"
716 8682db42 2023-02-07 thomas test_status_gitignore_trailing_slashes() {
717 8682db42 2023-02-07 thomas local testroot=`test_init status_gitignore_trailing_slashes`
719 8682db42 2023-02-07 thomas got checkout $testroot/repo $testroot/wt > /dev/null
721 8682db42 2023-02-07 thomas if [ $ret -ne 0 ]; then
722 8682db42 2023-02-07 thomas test_done "$testroot" "$ret"
726 8682db42 2023-02-07 thomas echo "unversioned file" > $testroot/wt/foo
727 8682db42 2023-02-07 thomas echo "unversioned file" > $testroot/wt/epsilon/bar
728 8682db42 2023-02-07 thomas echo "unversioned file" > $testroot/wt/epsilon/boo
729 8682db42 2023-02-07 thomas echo "unversioned file" > $testroot/wt/epsilon/moo
730 1b5d300f 2023-02-20 thomas echo "unversioned file" > $testroot/wt/upsilon
732 1b5d300f 2023-02-20 thomas # Match the directory epsilon but not the regular file upsilon
733 1b5d300f 2023-02-20 thomas echo "*psilon/" > $testroot/wt/.gitignore
735 8682db42 2023-02-07 thomas echo '? .gitignore' > $testroot/stdout.expected
736 8682db42 2023-02-07 thomas echo '? foo' >> $testroot/stdout.expected
737 1b5d300f 2023-02-20 thomas echo '? upsilon' >> $testroot/stdout.expected
738 8682db42 2023-02-07 thomas (cd $testroot/wt && got status > $testroot/stdout)
740 8682db42 2023-02-07 thomas cmp -s $testroot/stdout.expected $testroot/stdout
742 8682db42 2023-02-07 thomas if [ $ret -ne 0 ]; then
743 1b5d300f 2023-02-20 thomas diff -u $testroot/stdout.expected $testroot/stdout
745 8682db42 2023-02-07 thomas test_done "$testroot" "$ret"
748 f6cae3ed 2020-09-13 naddy test_status_status_code() {
749 081470ac 2020-08-13 stsp local testroot=`test_init status_status_code`
751 081470ac 2020-08-13 stsp got checkout $testroot/repo $testroot/wt > /dev/null
753 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
754 081470ac 2020-08-13 stsp test_done "$testroot" "$ret"
758 081470ac 2020-08-13 stsp echo "modified alpha" > $testroot/wt/alpha
759 081470ac 2020-08-13 stsp (cd $testroot/wt && got rm beta >/dev/null)
760 081470ac 2020-08-13 stsp echo "unversioned file" > $testroot/wt/foo
761 081470ac 2020-08-13 stsp rm $testroot/wt/epsilon/zeta
762 081470ac 2020-08-13 stsp touch $testroot/wt/beta
763 081470ac 2020-08-13 stsp echo "new file" > $testroot/wt/new
764 081470ac 2020-08-13 stsp (cd $testroot/wt && got add new >/dev/null)
766 081470ac 2020-08-13 stsp (cd $testroot/wt && got status -s xDM \
767 081470ac 2020-08-13 stsp > $testroot/stdout 2> $testroot/stderr)
769 fc414659 2022-04-16 thomas if [ $ret -eq 0 ]; then
770 081470ac 2020-08-13 stsp echo "status succeeded unexpectedly" >&2
771 081470ac 2020-08-13 stsp test_done "$testroot" "1"
775 081470ac 2020-08-13 stsp echo "got: invalid status code 'x'" > $testroot/stderr.expected
776 081470ac 2020-08-13 stsp cmp -s $testroot/stderr.expected $testroot/stderr
778 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
779 081470ac 2020-08-13 stsp diff -u $testroot/stderr.expected $testroot/stderr
780 081470ac 2020-08-13 stsp test_done "$testroot" "$ret"
784 081470ac 2020-08-13 stsp echo 'M alpha' > $testroot/stdout.expected
785 081470ac 2020-08-13 stsp (cd $testroot/wt && got status -s M > $testroot/stdout)
786 081470ac 2020-08-13 stsp cmp -s $testroot/stdout.expected $testroot/stdout
788 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
789 081470ac 2020-08-13 stsp diff -u $testroot/stdout.expected $testroot/stdout
790 081470ac 2020-08-13 stsp test_done "$testroot" "$ret"
794 081470ac 2020-08-13 stsp echo 'D beta' > $testroot/stdout.expected
795 081470ac 2020-08-13 stsp (cd $testroot/wt && got status -s D > $testroot/stdout)
796 081470ac 2020-08-13 stsp cmp -s $testroot/stdout.expected $testroot/stdout
798 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
799 081470ac 2020-08-13 stsp diff -u $testroot/stdout.expected $testroot/stdout
800 081470ac 2020-08-13 stsp test_done "$testroot" "$ret"
804 081470ac 2020-08-13 stsp echo '! epsilon/zeta' > $testroot/stdout.expected
805 081470ac 2020-08-13 stsp echo '? foo' >> $testroot/stdout.expected
806 67d7451c 2021-09-15 naddy (cd $testroot/wt && got status -s !\? > $testroot/stdout)
807 081470ac 2020-08-13 stsp cmp -s $testroot/stdout.expected $testroot/stdout
809 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
810 081470ac 2020-08-13 stsp diff -u $testroot/stdout.expected $testroot/stdout
811 081470ac 2020-08-13 stsp test_done "$testroot" "$ret"
815 081470ac 2020-08-13 stsp echo 'A new' > $testroot/stdout.expected
816 081470ac 2020-08-13 stsp (cd $testroot/wt && got status -s A > $testroot/stdout)
817 081470ac 2020-08-13 stsp cmp -s $testroot/stdout.expected $testroot/stdout
819 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
820 081470ac 2020-08-13 stsp diff -u $testroot/stdout.expected $testroot/stdout
821 081470ac 2020-08-13 stsp test_done "$testroot" "$ret"
825 081470ac 2020-08-13 stsp (cd $testroot/wt && got stage new > $testroot/stdout)
827 081470ac 2020-08-13 stsp echo ' A new' > $testroot/stdout.expected
828 081470ac 2020-08-13 stsp (cd $testroot/wt && got status -s A > $testroot/stdout)
829 081470ac 2020-08-13 stsp cmp -s $testroot/stdout.expected $testroot/stdout
831 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
832 081470ac 2020-08-13 stsp diff -u $testroot/stdout.expected $testroot/stdout
833 081470ac 2020-08-13 stsp test_done "$testroot" "$ret"
837 081470ac 2020-08-13 stsp echo 'changed file new' > $testroot/wt/new
839 081470ac 2020-08-13 stsp echo 'MA new' > $testroot/stdout.expected
840 081470ac 2020-08-13 stsp (cd $testroot/wt && got status -s A > $testroot/stdout)
841 081470ac 2020-08-13 stsp cmp -s $testroot/stdout.expected $testroot/stdout
843 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
844 081470ac 2020-08-13 stsp diff -u $testroot/stdout.expected $testroot/stdout
845 081470ac 2020-08-13 stsp test_done "$testroot" "$ret"
849 081470ac 2020-08-13 stsp echo 'M alpha' > $testroot/stdout.expected
850 081470ac 2020-08-13 stsp echo 'MA new' >> $testroot/stdout.expected
851 081470ac 2020-08-13 stsp (cd $testroot/wt && got status -s M > $testroot/stdout)
852 67c65ed7 2021-09-14 tracey cmp -s $testroot/stdout.expected $testroot/stdout
854 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
855 67c65ed7 2021-09-14 tracey diff -u $testroot/stdout.expected $testroot/stdout
856 67c65ed7 2021-09-14 tracey test_done "$testroot" "$ret"
860 67c65ed7 2021-09-14 tracey test_done "$testroot" "$ret"
863 67c65ed7 2021-09-14 tracey test_status_suppress() {
864 67c65ed7 2021-09-14 tracey local testroot=`test_init status_suppress`
866 67c65ed7 2021-09-14 tracey got checkout $testroot/repo $testroot/wt > /dev/null
868 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
869 67c65ed7 2021-09-14 tracey test_done "$testroot" "$ret"
873 67c65ed7 2021-09-14 tracey echo "modified alpha" > $testroot/wt/alpha
874 67c65ed7 2021-09-14 tracey (cd $testroot/wt && got rm beta >/dev/null)
875 67c65ed7 2021-09-14 tracey echo "unversioned file" > $testroot/wt/foo
876 67c65ed7 2021-09-14 tracey rm $testroot/wt/epsilon/zeta
877 67c65ed7 2021-09-14 tracey touch $testroot/wt/beta
878 67c65ed7 2021-09-14 tracey echo "new file" > $testroot/wt/new
879 67c65ed7 2021-09-14 tracey (cd $testroot/wt && got add new >/dev/null)
881 e3a46353 2021-09-14 stsp (cd $testroot/wt && got status -S A -s M \
882 e3a46353 2021-09-14 stsp > $testroot/stdout 2> $testroot/stderr)
884 fc414659 2022-04-16 thomas if [ $ret -eq 0 ]; then
885 e3a46353 2021-09-14 stsp echo "status succeeded unexpectedly" >&2
886 e3a46353 2021-09-14 stsp test_done "$testroot" "1"
890 e3a46353 2021-09-14 stsp echo "got: -s and -S options are mutually exclusive" \
891 e3a46353 2021-09-14 stsp > $testroot/stderr.expected
892 e3a46353 2021-09-14 stsp cmp -s $testroot/stderr.expected $testroot/stderr
894 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
895 e3a46353 2021-09-14 stsp diff -u $testroot/stderr.expected $testroot/stderr
896 e3a46353 2021-09-14 stsp test_done "$testroot" "$ret"
900 e3a46353 2021-09-14 stsp (cd $testroot/wt && got status -s A -S M \
901 e3a46353 2021-09-14 stsp > $testroot/stdout 2> $testroot/stderr)
903 fc414659 2022-04-16 thomas if [ $ret -eq 0 ]; then
904 e3a46353 2021-09-14 stsp echo "status succeeded unexpectedly" >&2
905 e3a46353 2021-09-14 stsp test_done "$testroot" "1"
909 e3a46353 2021-09-14 stsp echo "got: -S and -s options are mutually exclusive" \
910 e3a46353 2021-09-14 stsp > $testroot/stderr.expected
911 e3a46353 2021-09-14 stsp cmp -s $testroot/stderr.expected $testroot/stderr
913 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
914 e3a46353 2021-09-14 stsp diff -u $testroot/stderr.expected $testroot/stderr
915 e3a46353 2021-09-14 stsp test_done "$testroot" "$ret"
919 67c65ed7 2021-09-14 tracey (cd $testroot/wt && got status -S xDM \
920 67c65ed7 2021-09-14 tracey > $testroot/stdout 2> $testroot/stderr)
922 fc414659 2022-04-16 thomas if [ $ret -eq 0 ]; then
923 67c65ed7 2021-09-14 tracey echo "status succeeded unexpectedly" >&2
924 67c65ed7 2021-09-14 tracey test_done "$testroot" "1"
928 67c65ed7 2021-09-14 tracey echo "got: invalid status code 'x'" > $testroot/stderr.expected
929 67c65ed7 2021-09-14 tracey cmp -s $testroot/stderr.expected $testroot/stderr
931 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
932 67c65ed7 2021-09-14 tracey diff -u $testroot/stderr.expected $testroot/stderr
933 67c65ed7 2021-09-14 tracey test_done "$testroot" "$ret"
937 67c65ed7 2021-09-14 tracey echo 'M alpha' > $testroot/stdout.expected
938 67d7451c 2021-09-15 naddy (cd $testroot/wt && got status -S D\?A! > $testroot/stdout)
939 67c65ed7 2021-09-14 tracey cmp -s $testroot/stdout.expected $testroot/stdout
941 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
942 67c65ed7 2021-09-14 tracey diff -u $testroot/stdout.expected $testroot/stdout
943 67c65ed7 2021-09-14 tracey test_done "$testroot" "$ret"
947 67c65ed7 2021-09-14 tracey echo 'D beta' > $testroot/stdout.expected
948 67d7451c 2021-09-15 naddy (cd $testroot/wt && got status -S M\?A! > $testroot/stdout)
949 67c65ed7 2021-09-14 tracey cmp -s $testroot/stdout.expected $testroot/stdout
951 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
952 67c65ed7 2021-09-14 tracey diff -u $testroot/stdout.expected $testroot/stdout
953 67c65ed7 2021-09-14 tracey test_done "$testroot" "$ret"
957 67c65ed7 2021-09-14 tracey echo '! epsilon/zeta' > $testroot/stdout.expected
958 67c65ed7 2021-09-14 tracey echo '? foo' >> $testroot/stdout.expected
959 67c65ed7 2021-09-14 tracey (cd $testroot/wt && got status -S MDA > $testroot/stdout)
960 081470ac 2020-08-13 stsp cmp -s $testroot/stdout.expected $testroot/stdout
962 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
963 081470ac 2020-08-13 stsp diff -u $testroot/stdout.expected $testroot/stdout
964 081470ac 2020-08-13 stsp test_done "$testroot" "$ret"
968 67c65ed7 2021-09-14 tracey echo 'A new' > $testroot/stdout.expected
969 67d7451c 2021-09-15 naddy (cd $testroot/wt && got status -S MD\?! > $testroot/stdout)
970 67c65ed7 2021-09-14 tracey cmp -s $testroot/stdout.expected $testroot/stdout
972 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
973 67c65ed7 2021-09-14 tracey diff -u $testroot/stdout.expected $testroot/stdout
974 67c65ed7 2021-09-14 tracey test_done "$testroot" "$ret"
978 67c65ed7 2021-09-14 tracey (cd $testroot/wt && got stage new > $testroot/stdout)
980 67c65ed7 2021-09-14 tracey echo ' A new' > $testroot/stdout.expected
981 67d7451c 2021-09-15 naddy (cd $testroot/wt && got status -S MD\?! > $testroot/stdout)
982 67c65ed7 2021-09-14 tracey cmp -s $testroot/stdout.expected $testroot/stdout
984 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
985 67c65ed7 2021-09-14 tracey diff -u $testroot/stdout.expected $testroot/stdout
986 67c65ed7 2021-09-14 tracey test_done "$testroot" "$ret"
990 67c65ed7 2021-09-14 tracey echo 'changed file new' > $testroot/wt/new
992 67c65ed7 2021-09-14 tracey echo 'M alpha' > $testroot/stdout.expected
993 67c65ed7 2021-09-14 tracey echo 'MA new' >> $testroot/stdout.expected
994 67d7451c 2021-09-15 naddy (cd $testroot/wt && got status -S D\?! > $testroot/stdout)
995 67c65ed7 2021-09-14 tracey cmp -s $testroot/stdout.expected $testroot/stdout
997 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
998 67c65ed7 2021-09-14 tracey diff -u $testroot/stdout.expected $testroot/stdout
999 67c65ed7 2021-09-14 tracey test_done "$testroot" "$ret"
1000 67c65ed7 2021-09-14 tracey return 1
1003 67c65ed7 2021-09-14 tracey echo 'M alpha' > $testroot/stdout.expected
1004 67d7451c 2021-09-15 naddy (cd $testroot/wt && got status -S AD\?! > $testroot/stdout)
1005 67c65ed7 2021-09-14 tracey cmp -s $testroot/stdout.expected $testroot/stdout
1007 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
1008 67c65ed7 2021-09-14 tracey diff -u $testroot/stdout.expected $testroot/stdout
1009 67c65ed7 2021-09-14 tracey test_done "$testroot" "$ret"
1010 67c65ed7 2021-09-14 tracey return 1
1013 67c65ed7 2021-09-14 tracey rm $testroot/stdout.expected
1014 67c65ed7 2021-09-14 tracey touch $testroot/stdout.expected
1016 67d7451c 2021-09-15 naddy (cd $testroot/wt && got status -S MD\?! > $testroot/stdout)
1017 67c65ed7 2021-09-14 tracey cmp -s $testroot/stdout.expected $testroot/stdout
1019 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
1020 67c65ed7 2021-09-14 tracey diff -u $testroot/stdout.expected $testroot/stdout
1021 67c65ed7 2021-09-14 tracey test_done "$testroot" "$ret"
1022 67c65ed7 2021-09-14 tracey return 1
1025 081470ac 2020-08-13 stsp test_done "$testroot" "$ret"
1028 4a26d3f8 2020-10-07 stsp test_status_empty_file() {
1029 4a26d3f8 2020-10-07 stsp local testroot=`test_init status_empty_file`
1031 4a26d3f8 2020-10-07 stsp got checkout $testroot/repo $testroot/wt > /dev/null
1033 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
1034 4a26d3f8 2020-10-07 stsp test_done "$testroot" "$ret"
1038 4a26d3f8 2020-10-07 stsp echo -n "" > $testroot/wt/empty
1039 4a26d3f8 2020-10-07 stsp (cd $testroot/wt && got add empty >/dev/null)
1041 4a26d3f8 2020-10-07 stsp echo 'A empty' > $testroot/stdout.expected
1043 4a26d3f8 2020-10-07 stsp (cd $testroot/wt && got status > $testroot/stdout)
1045 4a26d3f8 2020-10-07 stsp cmp -s $testroot/stdout.expected $testroot/stdout
1047 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
1048 4a26d3f8 2020-10-07 stsp diff -u $testroot/stdout.expected $testroot/stdout
1049 4a26d3f8 2020-10-07 stsp test_done "$testroot" "$ret"
1053 4a26d3f8 2020-10-07 stsp (cd $testroot/wt && got commit -m "empty file" >/dev/null)
1055 4a26d3f8 2020-10-07 stsp (cd $testroot/wt && got status > $testroot/stdout)
1057 4a26d3f8 2020-10-07 stsp echo -n > $testroot/stdout.expected
1058 4a26d3f8 2020-10-07 stsp cmp -s $testroot/stdout.expected $testroot/stdout
1060 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
1061 4a26d3f8 2020-10-07 stsp diff -u $testroot/stdout.expected $testroot/stdout
1062 4a26d3f8 2020-10-07 stsp test_done "$testroot" "$ret"
1066 4a26d3f8 2020-10-07 stsp # update the timestamp; this used to make the file show up as:
1068 4a26d3f8 2020-10-07 stsp # which should not happen
1069 4a26d3f8 2020-10-07 stsp touch $testroot/wt/empty
1071 4a26d3f8 2020-10-07 stsp (cd $testroot/wt && got status > $testroot/stdout)
1073 4a26d3f8 2020-10-07 stsp echo -n > $testroot/stdout.expected
1074 4a26d3f8 2020-10-07 stsp cmp -s $testroot/stdout.expected $testroot/stdout
1076 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
1077 4a26d3f8 2020-10-07 stsp diff -u $testroot/stdout.expected $testroot/stdout
1079 a914c6bf 2023-06-15 thomas test_done "$testroot" "$ret"
1082 a914c6bf 2023-06-15 thomas test_status_in_repo() {
1083 a914c6bf 2023-06-15 thomas local testroot=`test_init status_in_repo`
1085 a914c6bf 2023-06-15 thomas (cd $testroot/repo && got status > $testroot/stdout \
1086 a914c6bf 2023-06-15 thomas 2> $testroot/stderr)
1088 a914c6bf 2023-06-15 thomas cat > $testroot/stderr.expected <<EOF
1089 a914c6bf 2023-06-15 thomas got: 'got status' needs a work tree in addition to a git repository
1090 a914c6bf 2023-06-15 thomas Work trees can be checked out from this Git repository with 'got checkout'.
1091 a914c6bf 2023-06-15 thomas The got(1) manual page contains more information.
1093 a914c6bf 2023-06-15 thomas cmp -s $testroot/stderr.expected $testroot/stderr
1095 a914c6bf 2023-06-15 thomas if [ $ret -ne 0 ]; then
1096 a914c6bf 2023-06-15 thomas diff -u $testroot/stderr.expected $testroot/stderr
1098 4a26d3f8 2020-10-07 stsp test_done "$testroot" "$ret"
1101 7fb414ae 2020-08-08 stsp test_parseargs "$@"
1102 35dc4510 2019-02-04 stsp run_test test_status_basic
1103 f02ba292 2019-02-05 stsp run_test test_status_subdir_no_mods
1104 f02ba292 2019-02-05 stsp run_test test_status_subdir_no_mods2
1105 0dbc2271 2019-02-05 stsp run_test test_status_obstructed
1106 02c07007 2019-02-10 stsp run_test test_status_shows_local_mods_after_update
1107 18831e78 2019-02-10 stsp run_test test_status_unversioned_subdirs
1108 00bb5ea0 2020-07-23 stsp run_test test_status_symlink
1109 3cbbd752 2019-02-19 stsp run_test test_status_shows_no_mods_after_complete_merge
1110 7154f6ce 2019-03-27 stsp run_test test_status_shows_conflict
1111 c577a9ce 2019-07-27 stsp run_test test_status_empty_dir
1112 c577a9ce 2019-07-27 stsp run_test test_status_empty_dir_unversioned_file
1113 72ea6654 2019-07-27 stsp run_test test_status_many_paths
1114 6841da00 2019-08-08 stsp run_test test_status_cvsignore
1115 bd8de430 2019-10-04 stsp run_test test_status_gitignore
1116 8682db42 2023-02-07 thomas run_test test_status_gitignore_trailing_slashes
1117 081470ac 2020-08-13 stsp run_test test_status_status_code
1118 67c65ed7 2021-09-14 tracey run_test test_status_suppress
1119 4a26d3f8 2020-10-07 stsp run_test test_status_empty_file
1120 a914c6bf 2023-06-15 thomas run_test test_status_in_repo