Blame


1 cbd1af7a 2019-03-18 stsp #!/bin/sh
2 cbd1af7a 2019-03-18 stsp #
3 5aa81393 2020-01-06 stsp # Copyright (c) 2019, 2020 Stefan Sperling <stsp@openbsd.org>
4 cbd1af7a 2019-03-18 stsp #
5 cbd1af7a 2019-03-18 stsp # Permission to use, copy, modify, and distribute this software for any
6 cbd1af7a 2019-03-18 stsp # purpose with or without fee is hereby granted, provided that the above
7 cbd1af7a 2019-03-18 stsp # copyright notice and this permission notice appear in all copies.
8 cbd1af7a 2019-03-18 stsp #
9 cbd1af7a 2019-03-18 stsp # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 cbd1af7a 2019-03-18 stsp # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 cbd1af7a 2019-03-18 stsp # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 cbd1af7a 2019-03-18 stsp # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 cbd1af7a 2019-03-18 stsp # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 cbd1af7a 2019-03-18 stsp # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 cbd1af7a 2019-03-18 stsp # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 cbd1af7a 2019-03-18 stsp
17 cbd1af7a 2019-03-18 stsp . ./common.sh
18 cbd1af7a 2019-03-18 stsp
19 e7301579 2019-03-18 stsp function test_log_in_repo {
20 e7301579 2019-03-18 stsp local testroot=`test_init log_in_repo`
21 e7301579 2019-03-18 stsp local head_rev=`git_show_head $testroot/repo`
22 e7301579 2019-03-18 stsp
23 e7301579 2019-03-18 stsp echo "commit $head_rev (master)" > $testroot/stdout.expected
24 e7301579 2019-03-18 stsp
25 e7301579 2019-03-18 stsp for p in "" "." alpha epsilon epsilon/zeta; do
26 e7301579 2019-03-18 stsp (cd $testroot/repo && got log $p | \
27 e7301579 2019-03-18 stsp grep ^commit > $testroot/stdout)
28 8d301dd9 2019-05-14 stsp cmp -s $testroot/stdout.expected $testroot/stdout
29 e7301579 2019-03-18 stsp ret="$?"
30 e7301579 2019-03-18 stsp if [ "$ret" != "0" ]; then
31 e7301579 2019-03-18 stsp diff -u $testroot/stdout.expected $testroot/stdout
32 e7301579 2019-03-18 stsp test_done "$testroot" "$ret"
33 e7301579 2019-03-18 stsp return 1
34 e7301579 2019-03-18 stsp fi
35 e7301579 2019-03-18 stsp done
36 e7301579 2019-03-18 stsp
37 b70703ad 2019-03-18 stsp for p in "" "." zeta; do
38 b70703ad 2019-03-18 stsp (cd $testroot/repo/epsilon && got log $p | \
39 b70703ad 2019-03-18 stsp grep ^commit > $testroot/stdout)
40 8d301dd9 2019-05-14 stsp cmp -s $testroot/stdout.expected $testroot/stdout
41 b70703ad 2019-03-18 stsp ret="$?"
42 b70703ad 2019-03-18 stsp if [ "$ret" != "0" ]; then
43 b70703ad 2019-03-18 stsp diff -u $testroot/stdout.expected $testroot/stdout
44 b70703ad 2019-03-18 stsp test_done "$testroot" "$ret"
45 b70703ad 2019-03-18 stsp return 1
46 b70703ad 2019-03-18 stsp fi
47 b70703ad 2019-03-18 stsp done
48 b70703ad 2019-03-18 stsp
49 e7301579 2019-03-18 stsp test_done "$testroot" "0"
50 e7301579 2019-03-18 stsp }
51 e7301579 2019-03-18 stsp
52 b70703ad 2019-03-18 stsp function test_log_in_bare_repo {
53 b70703ad 2019-03-18 stsp local testroot=`test_init log_in_bare_repo`
54 b70703ad 2019-03-18 stsp local head_rev=`git_show_head $testroot/repo`
55 b70703ad 2019-03-18 stsp
56 b70703ad 2019-03-18 stsp echo "commit $head_rev (master)" > $testroot/stdout.expected
57 b70703ad 2019-03-18 stsp
58 b70703ad 2019-03-18 stsp for p in "" "." alpha epsilon epsilon/zeta; do
59 b70703ad 2019-03-18 stsp (cd $testroot/repo/.git && got log $p | \
60 b70703ad 2019-03-18 stsp grep ^commit > $testroot/stdout)
61 8d301dd9 2019-05-14 stsp cmp -s $testroot/stdout.expected $testroot/stdout
62 b70703ad 2019-03-18 stsp ret="$?"
63 b70703ad 2019-03-18 stsp if [ "$ret" != "0" ]; then
64 b70703ad 2019-03-18 stsp diff -u $testroot/stdout.expected $testroot/stdout
65 b70703ad 2019-03-18 stsp test_done "$testroot" "$ret"
66 b70703ad 2019-03-18 stsp return 1
67 b70703ad 2019-03-18 stsp fi
68 b70703ad 2019-03-18 stsp done
69 b70703ad 2019-03-18 stsp
70 b70703ad 2019-03-18 stsp test_done "$testroot" "0"
71 b70703ad 2019-03-18 stsp }
72 b70703ad 2019-03-18 stsp
73 cbd1af7a 2019-03-18 stsp function test_log_in_worktree {
74 f43793a4 2020-01-27 stsp local testroot=`test_init log_in_worktree 1`
75 cbd1af7a 2019-03-18 stsp
76 f43793a4 2020-01-27 stsp make_test_tree $testroot/repo
77 f43793a4 2020-01-27 stsp mkdir -p $testroot/repo/epsilon/d
78 f43793a4 2020-01-27 stsp echo foo > $testroot/repo/epsilon/d/foo
79 f43793a4 2020-01-27 stsp (cd $testroot/repo && git add .)
80 f43793a4 2020-01-27 stsp git_commit $testroot/repo -m "adding the test tree"
81 f43793a4 2020-01-27 stsp local head_commit=`git_show_head $testroot/repo`
82 f43793a4 2020-01-27 stsp
83 cbd1af7a 2019-03-18 stsp got checkout $testroot/repo $testroot/wt > /dev/null
84 cbd1af7a 2019-03-18 stsp ret="$?"
85 cbd1af7a 2019-03-18 stsp if [ "$ret" != "0" ]; then
86 cbd1af7a 2019-03-18 stsp test_done "$testroot" "$ret"
87 cbd1af7a 2019-03-18 stsp return 1
88 cbd1af7a 2019-03-18 stsp fi
89 cbd1af7a 2019-03-18 stsp
90 f43793a4 2020-01-27 stsp echo "commit $head_commit (master)" > $testroot/stdout.expected
91 cbd1af7a 2019-03-18 stsp
92 cbd1af7a 2019-03-18 stsp for p in "" "." alpha epsilon; do
93 cbd1af7a 2019-03-18 stsp (cd $testroot/wt && got log $p | \
94 cbd1af7a 2019-03-18 stsp grep ^commit > $testroot/stdout)
95 8d301dd9 2019-05-14 stsp cmp -s $testroot/stdout.expected $testroot/stdout
96 cbd1af7a 2019-03-18 stsp ret="$?"
97 cbd1af7a 2019-03-18 stsp if [ "$ret" != "0" ]; then
98 cbd1af7a 2019-03-18 stsp diff -u $testroot/stdout.expected $testroot/stdout
99 cbd1af7a 2019-03-18 stsp test_done "$testroot" "$ret"
100 cbd1af7a 2019-03-18 stsp return 1
101 cbd1af7a 2019-03-18 stsp fi
102 cbd1af7a 2019-03-18 stsp done
103 cbd1af7a 2019-03-18 stsp
104 cbd1af7a 2019-03-18 stsp for p in "" "." zeta; do
105 cbd1af7a 2019-03-18 stsp (cd $testroot/wt/epsilon && got log $p | \
106 cbd1af7a 2019-03-18 stsp grep ^commit > $testroot/stdout)
107 8d301dd9 2019-05-14 stsp cmp -s $testroot/stdout.expected $testroot/stdout
108 cbd1af7a 2019-03-18 stsp ret="$?"
109 cbd1af7a 2019-03-18 stsp if [ "$ret" != "0" ]; then
110 cbd1af7a 2019-03-18 stsp diff -u $testroot/stdout.expected $testroot/stdout
111 cbd1af7a 2019-03-18 stsp test_done "$testroot" "$ret"
112 cbd1af7a 2019-03-18 stsp return 1
113 cbd1af7a 2019-03-18 stsp fi
114 cbd1af7a 2019-03-18 stsp done
115 cbd1af7a 2019-03-18 stsp
116 f43793a4 2020-01-27 stsp for p in "" "." foo; do
117 f43793a4 2020-01-27 stsp (cd $testroot/wt/epsilon && got log d/$p | \
118 f43793a4 2020-01-27 stsp grep ^commit > $testroot/stdout)
119 f43793a4 2020-01-27 stsp cmp -s $testroot/stdout.expected $testroot/stdout
120 f43793a4 2020-01-27 stsp ret="$?"
121 f43793a4 2020-01-27 stsp if [ "$ret" != "0" ]; then
122 f43793a4 2020-01-27 stsp diff -u $testroot/stdout.expected $testroot/stdout
123 f43793a4 2020-01-27 stsp test_done "$testroot" "$ret"
124 f43793a4 2020-01-27 stsp return 1
125 f43793a4 2020-01-27 stsp fi
126 f43793a4 2020-01-27 stsp done
127 f43793a4 2020-01-27 stsp
128 cbd1af7a 2019-03-18 stsp test_done "$testroot" "0"
129 cbd1af7a 2019-03-18 stsp }
130 cbd1af7a 2019-03-18 stsp
131 dfe70b4b 2019-08-27 stsp function test_log_in_worktree_with_path_prefix {
132 0cfcb52d 2019-08-27 stsp local testroot=`test_init log_in_prefixed_worktree`
133 0cfcb52d 2019-08-27 stsp local head_rev=`git_show_head $testroot/repo`
134 0cfcb52d 2019-08-27 stsp
135 0cfcb52d 2019-08-27 stsp echo "modified zeta" > $testroot/repo/epsilon/zeta
136 0cfcb52d 2019-08-27 stsp git_commit $testroot/repo -m "modified zeta"
137 0cfcb52d 2019-08-27 stsp local zeta_rev=`git_show_head $testroot/repo`
138 0cfcb52d 2019-08-27 stsp
139 0cfcb52d 2019-08-27 stsp echo "modified delta" > $testroot/repo/gamma/delta
140 0cfcb52d 2019-08-27 stsp git_commit $testroot/repo -m "modified delta"
141 0cfcb52d 2019-08-27 stsp
142 0cfcb52d 2019-08-27 stsp got checkout -p epsilon $testroot/repo $testroot/wt > /dev/null
143 0cfcb52d 2019-08-27 stsp ret="$?"
144 0cfcb52d 2019-08-27 stsp if [ "$ret" != "0" ]; then
145 0cfcb52d 2019-08-27 stsp test_done "$testroot" "$ret"
146 0cfcb52d 2019-08-27 stsp return 1
147 0cfcb52d 2019-08-27 stsp fi
148 0cfcb52d 2019-08-27 stsp
149 0cfcb52d 2019-08-27 stsp echo "commit $zeta_rev" > $testroot/stdout.expected
150 0cfcb52d 2019-08-27 stsp echo "commit $head_rev" >> $testroot/stdout.expected
151 0cfcb52d 2019-08-27 stsp
152 0cfcb52d 2019-08-27 stsp for p in "" "." zeta; do
153 0cfcb52d 2019-08-27 stsp (cd $testroot/wt && got log $p | \
154 0cfcb52d 2019-08-27 stsp grep ^commit > $testroot/stdout)
155 0cfcb52d 2019-08-27 stsp cmp -s $testroot/stdout.expected $testroot/stdout
156 0cfcb52d 2019-08-27 stsp ret="$?"
157 0cfcb52d 2019-08-27 stsp if [ "$ret" != "0" ]; then
158 0cfcb52d 2019-08-27 stsp diff -u $testroot/stdout.expected $testroot/stdout
159 0cfcb52d 2019-08-27 stsp test_done "$testroot" "$ret"
160 0cfcb52d 2019-08-27 stsp return 1
161 0cfcb52d 2019-08-27 stsp fi
162 0cfcb52d 2019-08-27 stsp done
163 0cfcb52d 2019-08-27 stsp
164 0cfcb52d 2019-08-27 stsp test_done "$testroot" "0"
165 0cfcb52d 2019-08-27 stsp }
166 0cfcb52d 2019-08-27 stsp
167 303e2782 2019-08-09 stsp function test_log_tag {
168 303e2782 2019-08-09 stsp local testroot=`test_init log_tag`
169 303e2782 2019-08-09 stsp local commit_id=`git_show_head $testroot/repo`
170 303e2782 2019-08-09 stsp local tag="1.0.0"
171 5a8ddf14 2019-08-13 stsp local tag2="2.0.0"
172 303e2782 2019-08-09 stsp
173 303e2782 2019-08-09 stsp got checkout $testroot/repo $testroot/wt > /dev/null
174 303e2782 2019-08-09 stsp ret="$?"
175 303e2782 2019-08-09 stsp if [ "$ret" != "0" ]; then
176 303e2782 2019-08-09 stsp test_done "$testroot" "$ret"
177 303e2782 2019-08-09 stsp return 1
178 303e2782 2019-08-09 stsp fi
179 303e2782 2019-08-09 stsp
180 303e2782 2019-08-09 stsp (cd $testroot/repo && git tag -a -m "test" $tag)
181 303e2782 2019-08-09 stsp
182 a436ad14 2019-08-13 stsp echo "commit $commit_id (master, tags/$tag)" > $testroot/stdout.expected
183 303e2782 2019-08-09 stsp (cd $testroot/wt && got log -l1 -c $tag | grep ^commit \
184 303e2782 2019-08-09 stsp > $testroot/stdout)
185 303e2782 2019-08-09 stsp cmp -s $testroot/stdout.expected $testroot/stdout
186 303e2782 2019-08-09 stsp ret="$?"
187 303e2782 2019-08-09 stsp if [ "$ret" != "0" ]; then
188 303e2782 2019-08-09 stsp diff -u $testroot/stdout.expected $testroot/stdout
189 5a8ddf14 2019-08-13 stsp test_done "$testroot" "$ret"
190 5a8ddf14 2019-08-13 stsp return 1
191 303e2782 2019-08-09 stsp fi
192 5a8ddf14 2019-08-13 stsp
193 992eb9d8 2020-02-07 tracey # test a "lightweight" tag
194 5a8ddf14 2019-08-13 stsp (cd $testroot/repo && git tag $tag2)
195 5a8ddf14 2019-08-13 stsp
196 5a8ddf14 2019-08-13 stsp echo "commit $commit_id (master, tags/$tag, tags/$tag2)" \
197 5a8ddf14 2019-08-13 stsp > $testroot/stdout.expected
198 5a8ddf14 2019-08-13 stsp (cd $testroot/wt && got log -l1 -c $tag2 | grep ^commit \
199 5a8ddf14 2019-08-13 stsp > $testroot/stdout)
200 5a8ddf14 2019-08-13 stsp cmp -s $testroot/stdout.expected $testroot/stdout
201 5a8ddf14 2019-08-13 stsp ret="$?"
202 5a8ddf14 2019-08-13 stsp if [ "$ret" != "0" ]; then
203 5a8ddf14 2019-08-13 stsp diff -u $testroot/stdout.expected $testroot/stdout
204 5a8ddf14 2019-08-13 stsp fi
205 303e2782 2019-08-09 stsp test_done "$testroot" "$ret"
206 303e2782 2019-08-09 stsp }
207 303e2782 2019-08-09 stsp
208 b1ebc001 2019-08-13 stsp function test_log_limit {
209 b1ebc001 2019-08-13 stsp local testroot=`test_init log_limit`
210 b1ebc001 2019-08-13 stsp local commit_id0=`git_show_head $testroot/repo`
211 303e2782 2019-08-09 stsp
212 b1ebc001 2019-08-13 stsp got checkout $testroot/repo $testroot/wt > /dev/null
213 b1ebc001 2019-08-13 stsp ret="$?"
214 b1ebc001 2019-08-13 stsp if [ "$ret" != "0" ]; then
215 b1ebc001 2019-08-13 stsp test_done "$testroot" "$ret"
216 b1ebc001 2019-08-13 stsp return 1
217 b1ebc001 2019-08-13 stsp fi
218 b1ebc001 2019-08-13 stsp
219 b1ebc001 2019-08-13 stsp echo "modified alpha" > $testroot/wt/alpha
220 b1ebc001 2019-08-13 stsp (cd $testroot/wt && got commit -m 'test log_limit' > /dev/null)
221 b1ebc001 2019-08-13 stsp local commit_id1=`git_show_head $testroot/repo`
222 b1ebc001 2019-08-13 stsp
223 b1ebc001 2019-08-13 stsp (cd $testroot/wt && got rm beta >/dev/null)
224 b1ebc001 2019-08-13 stsp (cd $testroot/wt && got commit -m 'test log_limit' > /dev/null)
225 b1ebc001 2019-08-13 stsp local commit_id2=`git_show_head $testroot/repo`
226 b1ebc001 2019-08-13 stsp
227 b1ebc001 2019-08-13 stsp echo "new file" > $testroot/wt/new
228 b1ebc001 2019-08-13 stsp (cd $testroot/wt && got add new >/dev/null)
229 b1ebc001 2019-08-13 stsp (cd $testroot/wt && got commit -m 'test log_limit' > /dev/null)
230 b1ebc001 2019-08-13 stsp local commit_id3=`git_show_head $testroot/repo`
231 b1ebc001 2019-08-13 stsp
232 b1ebc001 2019-08-13 stsp # -l1 should print the first commit only
233 b1ebc001 2019-08-13 stsp echo "commit $commit_id3 (master)" > $testroot/stdout.expected
234 b1ebc001 2019-08-13 stsp (cd $testroot/wt && got log -l1 | grep ^commit > $testroot/stdout)
235 b1ebc001 2019-08-13 stsp cmp -s $testroot/stdout.expected $testroot/stdout
236 b1ebc001 2019-08-13 stsp ret="$?"
237 b1ebc001 2019-08-13 stsp if [ "$ret" != "0" ]; then
238 b1ebc001 2019-08-13 stsp diff -u $testroot/stdout.expected $testroot/stdout
239 b1ebc001 2019-08-13 stsp test_done "$testroot" "$ret"
240 b1ebc001 2019-08-13 stsp return 1
241 b1ebc001 2019-08-13 stsp fi
242 b1ebc001 2019-08-13 stsp
243 b1ebc001 2019-08-13 stsp # env var can be used to set a log limit without -l option
244 b1ebc001 2019-08-13 stsp echo "commit $commit_id3 (master)" > $testroot/stdout.expected
245 b1ebc001 2019-08-13 stsp echo "commit $commit_id2" >> $testroot/stdout.expected
246 b1ebc001 2019-08-13 stsp (cd $testroot/wt && env GOT_LOG_DEFAULT_LIMIT=2 got log | \
247 b1ebc001 2019-08-13 stsp grep ^commit > $testroot/stdout)
248 b1ebc001 2019-08-13 stsp cmp -s $testroot/stdout.expected $testroot/stdout
249 b1ebc001 2019-08-13 stsp ret="$?"
250 b1ebc001 2019-08-13 stsp if [ "$ret" != "0" ]; then
251 b1ebc001 2019-08-13 stsp diff -u $testroot/stdout.expected $testroot/stdout
252 b1ebc001 2019-08-13 stsp test_done "$testroot" "$ret"
253 b1ebc001 2019-08-13 stsp return 1
254 b1ebc001 2019-08-13 stsp fi
255 b1ebc001 2019-08-13 stsp
256 b1ebc001 2019-08-13 stsp # non-numeric env var is ignored
257 b1ebc001 2019-08-13 stsp (cd $testroot/wt && env GOT_LOG_DEFAULT_LIMIT=foobar got log | \
258 b1ebc001 2019-08-13 stsp grep ^commit > $testroot/stdout)
259 b1ebc001 2019-08-13 stsp echo "commit $commit_id3 (master)" > $testroot/stdout.expected
260 b1ebc001 2019-08-13 stsp echo "commit $commit_id2" >> $testroot/stdout.expected
261 b1ebc001 2019-08-13 stsp echo "commit $commit_id1" >> $testroot/stdout.expected
262 b1ebc001 2019-08-13 stsp echo "commit $commit_id0" >> $testroot/stdout.expected
263 b1ebc001 2019-08-13 stsp cmp -s $testroot/stdout.expected $testroot/stdout
264 b1ebc001 2019-08-13 stsp ret="$?"
265 b1ebc001 2019-08-13 stsp if [ "$ret" != "0" ]; then
266 b1ebc001 2019-08-13 stsp diff -u $testroot/stdout.expected $testroot/stdout
267 b1ebc001 2019-08-13 stsp test_done "$testroot" "$ret"
268 b1ebc001 2019-08-13 stsp return 1
269 b1ebc001 2019-08-13 stsp fi
270 b1ebc001 2019-08-13 stsp
271 b1ebc001 2019-08-13 stsp # -l option takes precedence over env var
272 b1ebc001 2019-08-13 stsp echo "commit $commit_id3 (master)" > $testroot/stdout.expected
273 b1ebc001 2019-08-13 stsp echo "commit $commit_id2" >> $testroot/stdout.expected
274 b1ebc001 2019-08-13 stsp echo "commit $commit_id1" >> $testroot/stdout.expected
275 b1ebc001 2019-08-13 stsp echo "commit $commit_id0" >> $testroot/stdout.expected
276 b1ebc001 2019-08-13 stsp (cd $testroot/wt && env GOT_LOG_DEFAULT_LIMIT=1 got log -l0 | \
277 b1ebc001 2019-08-13 stsp grep ^commit > $testroot/stdout)
278 b1ebc001 2019-08-13 stsp cmp -s $testroot/stdout.expected $testroot/stdout
279 b1ebc001 2019-08-13 stsp ret="$?"
280 b1ebc001 2019-08-13 stsp if [ "$ret" != "0" ]; then
281 b1ebc001 2019-08-13 stsp diff -u $testroot/stdout.expected $testroot/stdout
282 b1ebc001 2019-08-13 stsp fi
283 b1ebc001 2019-08-13 stsp test_done "$testroot" "0"
284 b1ebc001 2019-08-13 stsp }
285 5175b31a 2020-01-04 stsp
286 5175b31a 2020-01-04 stsp function test_log_nonexistent_path {
287 5175b31a 2020-01-04 stsp local testroot=`test_init log_nonexistent_path`
288 5175b31a 2020-01-04 stsp local head_rev=`git_show_head $testroot/repo`
289 5175b31a 2020-01-04 stsp
290 5175b31a 2020-01-04 stsp echo "commit $head_rev (master)" > $testroot/stdout.expected
291 b1ebc001 2019-08-13 stsp
292 5175b31a 2020-01-04 stsp (cd $testroot/repo && got log this/does/not/exist \
293 5175b31a 2020-01-04 stsp > $testroot/stdout 2> $testroot/stderr)
294 5175b31a 2020-01-04 stsp ret="$?"
295 5175b31a 2020-01-04 stsp if [ "$ret" == "0" ]; then
296 5175b31a 2020-01-04 stsp echo "log command succeeded unexpectedly" >&2
297 5175b31a 2020-01-04 stsp test_done "$testroot" "1"
298 5175b31a 2020-01-04 stsp return 1
299 5175b31a 2020-01-04 stsp fi
300 5175b31a 2020-01-04 stsp
301 5175b31a 2020-01-04 stsp echo -n > $testroot/stdout.expected
302 5175b31a 2020-01-04 stsp cmp -s $testroot/stdout.expected $testroot/stdout
303 5175b31a 2020-01-04 stsp ret="$?"
304 5175b31a 2020-01-04 stsp if [ "$ret" != "0" ]; then
305 5175b31a 2020-01-04 stsp diff -u $testroot/stdout.expected $testroot/stdout
306 5175b31a 2020-01-04 stsp test_done "$testroot" "$ret"
307 5175b31a 2020-01-04 stsp return 1
308 5175b31a 2020-01-04 stsp fi
309 5175b31a 2020-01-04 stsp
310 5175b31a 2020-01-04 stsp echo "got: this/does/not/exist: no such entry found in tree" \
311 5175b31a 2020-01-04 stsp > $testroot/stderr.expected
312 5175b31a 2020-01-04 stsp cmp -s $testroot/stderr.expected $testroot/stderr
313 5175b31a 2020-01-04 stsp ret="$?"
314 5175b31a 2020-01-04 stsp if [ "$ret" != "0" ]; then
315 5175b31a 2020-01-04 stsp diff -u $testroot/stderr.expected $testroot/stderr
316 5175b31a 2020-01-04 stsp fi
317 5175b31a 2020-01-04 stsp test_done "$testroot" "$ret"
318 5175b31a 2020-01-04 stsp }
319 5175b31a 2020-01-04 stsp
320 e7301579 2019-03-18 stsp run_test test_log_in_repo
321 b70703ad 2019-03-18 stsp run_test test_log_in_bare_repo
322 cbd1af7a 2019-03-18 stsp run_test test_log_in_worktree
323 dfe70b4b 2019-08-27 stsp run_test test_log_in_worktree_with_path_prefix
324 303e2782 2019-08-09 stsp run_test test_log_tag
325 b1ebc001 2019-08-13 stsp run_test test_log_limit
326 5175b31a 2020-01-04 stsp run_test test_log_nonexistent_path