Blame


1 818c7501 2019-07-11 stsp #!/bin/sh
2 818c7501 2019-07-11 stsp #
3 5aa81393 2020-01-06 stsp # Copyright (c) 2019, 2020 Stefan Sperling <stsp@openbsd.org>
4 818c7501 2019-07-11 stsp #
5 818c7501 2019-07-11 stsp # Permission to use, copy, modify, and distribute this software for any
6 818c7501 2019-07-11 stsp # purpose with or without fee is hereby granted, provided that the above
7 818c7501 2019-07-11 stsp # copyright notice and this permission notice appear in all copies.
8 818c7501 2019-07-11 stsp #
9 818c7501 2019-07-11 stsp # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 818c7501 2019-07-11 stsp # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 818c7501 2019-07-11 stsp # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 818c7501 2019-07-11 stsp # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 818c7501 2019-07-11 stsp # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 818c7501 2019-07-11 stsp # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 818c7501 2019-07-11 stsp # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 818c7501 2019-07-11 stsp
17 818c7501 2019-07-11 stsp . ./common.sh
18 818c7501 2019-07-11 stsp
19 818c7501 2019-07-11 stsp function test_rebase_basic {
20 818c7501 2019-07-11 stsp local testroot=`test_init rebase_basic`
21 818c7501 2019-07-11 stsp
22 818c7501 2019-07-11 stsp (cd $testroot/repo && git checkout -q -b newbranch)
23 818c7501 2019-07-11 stsp echo "modified delta on branch" > $testroot/repo/gamma/delta
24 818c7501 2019-07-11 stsp git_commit $testroot/repo -m "committing to delta on newbranch"
25 818c7501 2019-07-11 stsp
26 818c7501 2019-07-11 stsp echo "modified alpha on branch" > $testroot/repo/alpha
27 818c7501 2019-07-11 stsp (cd $testroot/repo && git rm -q beta)
28 818c7501 2019-07-11 stsp echo "new file on branch" > $testroot/repo/epsilon/new
29 818c7501 2019-07-11 stsp (cd $testroot/repo && git add epsilon/new)
30 818c7501 2019-07-11 stsp git_commit $testroot/repo -m "committing more changes on newbranch"
31 818c7501 2019-07-11 stsp
32 818c7501 2019-07-11 stsp local orig_commit1=`git_show_parent_commit $testroot/repo`
33 818c7501 2019-07-11 stsp local orig_commit2=`git_show_head $testroot/repo`
34 818c7501 2019-07-11 stsp
35 818c7501 2019-07-11 stsp (cd $testroot/repo && git checkout -q master)
36 818c7501 2019-07-11 stsp echo "modified zeta on master" > $testroot/repo/epsilon/zeta
37 818c7501 2019-07-11 stsp git_commit $testroot/repo -m "committing to zeta on master"
38 818c7501 2019-07-11 stsp local master_commit=`git_show_head $testroot/repo`
39 818c7501 2019-07-11 stsp
40 818c7501 2019-07-11 stsp got checkout $testroot/repo $testroot/wt > /dev/null
41 818c7501 2019-07-11 stsp ret="$?"
42 818c7501 2019-07-11 stsp if [ "$ret" != "0" ]; then
43 818c7501 2019-07-11 stsp test_done "$testroot" "$ret"
44 818c7501 2019-07-11 stsp return 1
45 818c7501 2019-07-11 stsp fi
46 818c7501 2019-07-11 stsp
47 818c7501 2019-07-11 stsp (cd $testroot/wt && got rebase newbranch > $testroot/stdout)
48 818c7501 2019-07-11 stsp
49 818c7501 2019-07-11 stsp (cd $testroot/repo && git checkout -q newbranch)
50 818c7501 2019-07-11 stsp local new_commit1=`git_show_parent_commit $testroot/repo`
51 818c7501 2019-07-11 stsp local new_commit2=`git_show_head $testroot/repo`
52 818c7501 2019-07-11 stsp
53 818c7501 2019-07-11 stsp local short_orig_commit1=`trim_obj_id 28 $orig_commit1`
54 818c7501 2019-07-11 stsp local short_orig_commit2=`trim_obj_id 28 $orig_commit2`
55 818c7501 2019-07-11 stsp local short_new_commit1=`trim_obj_id 28 $new_commit1`
56 818c7501 2019-07-11 stsp local short_new_commit2=`trim_obj_id 28 $new_commit2`
57 818c7501 2019-07-11 stsp
58 818c7501 2019-07-11 stsp echo "G gamma/delta" >> $testroot/stdout.expected
59 818c7501 2019-07-11 stsp echo -n "$short_orig_commit1 -> $short_new_commit1" \
60 818c7501 2019-07-11 stsp >> $testroot/stdout.expected
61 818c7501 2019-07-11 stsp echo ": committing to delta on newbranch" >> $testroot/stdout.expected
62 818c7501 2019-07-11 stsp echo "G alpha" >> $testroot/stdout.expected
63 818c7501 2019-07-11 stsp echo "D beta" >> $testroot/stdout.expected
64 818c7501 2019-07-11 stsp echo "A epsilon/new" >> $testroot/stdout.expected
65 818c7501 2019-07-11 stsp echo -n "$short_orig_commit2 -> $short_new_commit2" \
66 818c7501 2019-07-11 stsp >> $testroot/stdout.expected
67 818c7501 2019-07-11 stsp echo ": committing more changes on newbranch" \
68 818c7501 2019-07-11 stsp >> $testroot/stdout.expected
69 818c7501 2019-07-11 stsp echo "Switching work tree to refs/heads/newbranch" \
70 818c7501 2019-07-11 stsp >> $testroot/stdout.expected
71 818c7501 2019-07-11 stsp
72 818c7501 2019-07-11 stsp cmp -s $testroot/stdout.expected $testroot/stdout
73 818c7501 2019-07-11 stsp ret="$?"
74 818c7501 2019-07-11 stsp if [ "$ret" != "0" ]; then
75 818c7501 2019-07-11 stsp diff -u $testroot/stdout.expected $testroot/stdout
76 818c7501 2019-07-11 stsp test_done "$testroot" "$ret"
77 818c7501 2019-07-11 stsp return 1
78 818c7501 2019-07-11 stsp fi
79 818c7501 2019-07-11 stsp
80 818c7501 2019-07-11 stsp echo "modified delta on branch" > $testroot/content.expected
81 818c7501 2019-07-11 stsp cat $testroot/wt/gamma/delta > $testroot/content
82 818c7501 2019-07-11 stsp cmp -s $testroot/content.expected $testroot/content
83 818c7501 2019-07-11 stsp ret="$?"
84 818c7501 2019-07-11 stsp if [ "$ret" != "0" ]; then
85 818c7501 2019-07-11 stsp diff -u $testroot/content.expected $testroot/content
86 818c7501 2019-07-11 stsp test_done "$testroot" "$ret"
87 818c7501 2019-07-11 stsp return 1
88 818c7501 2019-07-11 stsp fi
89 818c7501 2019-07-11 stsp
90 818c7501 2019-07-11 stsp echo "modified alpha on branch" > $testroot/content.expected
91 818c7501 2019-07-11 stsp cat $testroot/wt/alpha > $testroot/content
92 818c7501 2019-07-11 stsp cmp -s $testroot/content.expected $testroot/content
93 818c7501 2019-07-11 stsp ret="$?"
94 818c7501 2019-07-11 stsp if [ "$ret" != "0" ]; then
95 818c7501 2019-07-11 stsp diff -u $testroot/content.expected $testroot/content
96 818c7501 2019-07-11 stsp test_done "$testroot" "$ret"
97 818c7501 2019-07-11 stsp return 1
98 818c7501 2019-07-11 stsp fi
99 818c7501 2019-07-11 stsp
100 818c7501 2019-07-11 stsp if [ -e $testroot/wt/beta ]; then
101 818c7501 2019-07-11 stsp echo "removed file beta still exists on disk" >&2
102 818c7501 2019-07-11 stsp test_done "$testroot" "1"
103 818c7501 2019-07-11 stsp return 1
104 818c7501 2019-07-11 stsp fi
105 818c7501 2019-07-11 stsp
106 818c7501 2019-07-11 stsp echo "new file on branch" > $testroot/content.expected
107 818c7501 2019-07-11 stsp cat $testroot/wt/epsilon/new > $testroot/content
108 818c7501 2019-07-11 stsp cmp -s $testroot/content.expected $testroot/content
109 818c7501 2019-07-11 stsp ret="$?"
110 818c7501 2019-07-11 stsp if [ "$ret" != "0" ]; then
111 818c7501 2019-07-11 stsp diff -u $testroot/content.expected $testroot/content
112 818c7501 2019-07-11 stsp test_done "$testroot" "$ret"
113 818c7501 2019-07-11 stsp return 1
114 818c7501 2019-07-11 stsp fi
115 818c7501 2019-07-11 stsp
116 818c7501 2019-07-11 stsp (cd $testroot/wt && got status > $testroot/stdout)
117 818c7501 2019-07-11 stsp
118 818c7501 2019-07-11 stsp echo -n > $testroot/stdout.expected
119 818c7501 2019-07-11 stsp cmp -s $testroot/stdout.expected $testroot/stdout
120 818c7501 2019-07-11 stsp ret="$?"
121 818c7501 2019-07-11 stsp if [ "$ret" != "0" ]; then
122 818c7501 2019-07-11 stsp diff -u $testroot/stdout.expected $testroot/stdout
123 818c7501 2019-07-11 stsp test_done "$testroot" "$ret"
124 818c7501 2019-07-11 stsp return 1
125 818c7501 2019-07-11 stsp fi
126 818c7501 2019-07-11 stsp
127 818c7501 2019-07-11 stsp (cd $testroot/wt && got log -l3 | grep ^commit > $testroot/stdout)
128 818c7501 2019-07-11 stsp echo "commit $new_commit2 (newbranch)" > $testroot/stdout.expected
129 818c7501 2019-07-11 stsp echo "commit $new_commit1" >> $testroot/stdout.expected
130 818c7501 2019-07-11 stsp echo "commit $master_commit (master)" >> $testroot/stdout.expected
131 818c7501 2019-07-11 stsp cmp -s $testroot/stdout.expected $testroot/stdout
132 818c7501 2019-07-11 stsp ret="$?"
133 818c7501 2019-07-11 stsp if [ "$ret" != "0" ]; then
134 818c7501 2019-07-11 stsp diff -u $testroot/stdout.expected $testroot/stdout
135 818c7501 2019-07-11 stsp fi
136 818c7501 2019-07-11 stsp test_done "$testroot" "$ret"
137 818c7501 2019-07-11 stsp }
138 818c7501 2019-07-11 stsp
139 818c7501 2019-07-11 stsp function test_rebase_ancestry_check {
140 818c7501 2019-07-11 stsp local testroot=`test_init rebase_ancestry_check`
141 818c7501 2019-07-11 stsp
142 818c7501 2019-07-11 stsp got checkout $testroot/repo $testroot/wt > /dev/null
143 818c7501 2019-07-11 stsp ret="$?"
144 818c7501 2019-07-11 stsp if [ "$ret" != "0" ]; then
145 818c7501 2019-07-11 stsp test_done "$testroot" "$ret"
146 818c7501 2019-07-11 stsp return 1
147 818c7501 2019-07-11 stsp fi
148 818c7501 2019-07-11 stsp
149 818c7501 2019-07-11 stsp (cd $testroot/repo && git checkout -q -b newbranch)
150 818c7501 2019-07-11 stsp echo "modified delta on branch" > $testroot/repo/gamma/delta
151 818c7501 2019-07-11 stsp git_commit $testroot/repo -m "committing to delta on newbranch"
152 818c7501 2019-07-11 stsp
153 818c7501 2019-07-11 stsp (cd $testroot/wt && got rebase newbranch > $testroot/stdout \
154 818c7501 2019-07-11 stsp 2> $testroot/stderr)
155 818c7501 2019-07-11 stsp
156 818c7501 2019-07-11 stsp echo -n > $testroot/stdout.expected
157 818c7501 2019-07-11 stsp cmp -s $testroot/stdout.expected $testroot/stdout
158 818c7501 2019-07-11 stsp ret="$?"
159 818c7501 2019-07-11 stsp if [ "$ret" != "0" ]; then
160 818c7501 2019-07-11 stsp diff -u $testroot/stdout.expected $testroot/stdout
161 818c7501 2019-07-11 stsp test_done "$testroot" "$ret"
162 818c7501 2019-07-11 stsp return 1
163 818c7501 2019-07-11 stsp fi
164 818c7501 2019-07-11 stsp
165 818c7501 2019-07-11 stsp echo -n "got: specified branch resolves to a commit " \
166 818c7501 2019-07-11 stsp > $testroot/stderr.expected
167 818c7501 2019-07-11 stsp echo "which is already contained in work tree's branch" \
168 818c7501 2019-07-11 stsp >> $testroot/stderr.expected
169 818c7501 2019-07-11 stsp cmp -s $testroot/stderr.expected $testroot/stderr
170 818c7501 2019-07-11 stsp ret="$?"
171 818c7501 2019-07-11 stsp if [ "$ret" != "0" ]; then
172 818c7501 2019-07-11 stsp diff -u $testroot/stderr.expected $testroot/stderr
173 818c7501 2019-07-11 stsp fi
174 818c7501 2019-07-11 stsp test_done "$testroot" "$ret"
175 818c7501 2019-07-11 stsp }
176 818c7501 2019-07-11 stsp
177 818c7501 2019-07-11 stsp function test_rebase_continue {
178 818c7501 2019-07-11 stsp local testroot=`test_init rebase_continue`
179 f69721c3 2019-10-21 stsp local init_commit=`git_show_head $testroot/repo`
180 818c7501 2019-07-11 stsp
181 818c7501 2019-07-11 stsp (cd $testroot/repo && git checkout -q -b newbranch)
182 818c7501 2019-07-11 stsp echo "modified alpha on branch" > $testroot/repo/alpha
183 818c7501 2019-07-11 stsp git_commit $testroot/repo -m "committing to alpha on newbranch"
184 818c7501 2019-07-11 stsp local orig_commit1=`git_show_head $testroot/repo`
185 818c7501 2019-07-11 stsp
186 818c7501 2019-07-11 stsp (cd $testroot/repo && git checkout -q master)
187 818c7501 2019-07-11 stsp echo "modified alpha on master" > $testroot/repo/alpha
188 818c7501 2019-07-11 stsp git_commit $testroot/repo -m "committing to alpha on master"
189 818c7501 2019-07-11 stsp local master_commit=`git_show_head $testroot/repo`
190 818c7501 2019-07-11 stsp
191 818c7501 2019-07-11 stsp got checkout $testroot/repo $testroot/wt > /dev/null
192 818c7501 2019-07-11 stsp ret="$?"
193 818c7501 2019-07-11 stsp if [ "$ret" != "0" ]; then
194 818c7501 2019-07-11 stsp test_done "$testroot" "$ret"
195 818c7501 2019-07-11 stsp return 1
196 818c7501 2019-07-11 stsp fi
197 818c7501 2019-07-11 stsp
198 818c7501 2019-07-11 stsp (cd $testroot/wt && got rebase newbranch > $testroot/stdout \
199 818c7501 2019-07-11 stsp 2> $testroot/stderr)
200 818c7501 2019-07-11 stsp
201 818c7501 2019-07-11 stsp echo "C alpha" > $testroot/stdout.expected
202 818c7501 2019-07-11 stsp cmp -s $testroot/stdout.expected $testroot/stdout
203 818c7501 2019-07-11 stsp ret="$?"
204 818c7501 2019-07-11 stsp if [ "$ret" != "0" ]; then
205 818c7501 2019-07-11 stsp diff -u $testroot/stdout.expected $testroot/stdout
206 818c7501 2019-07-11 stsp test_done "$testroot" "$ret"
207 818c7501 2019-07-11 stsp return 1
208 818c7501 2019-07-11 stsp fi
209 818c7501 2019-07-11 stsp
210 11495e04 2019-07-12 stsp echo "got: conflicts must be resolved before rebasing can continue" \
211 818c7501 2019-07-11 stsp > $testroot/stderr.expected
212 818c7501 2019-07-11 stsp cmp -s $testroot/stderr.expected $testroot/stderr
213 818c7501 2019-07-11 stsp ret="$?"
214 818c7501 2019-07-11 stsp if [ "$ret" != "0" ]; then
215 818c7501 2019-07-11 stsp diff -u $testroot/stderr.expected $testroot/stderr
216 818c7501 2019-07-11 stsp test_done "$testroot" "$ret"
217 818c7501 2019-07-11 stsp return 1
218 818c7501 2019-07-11 stsp fi
219 818c7501 2019-07-11 stsp
220 f69721c3 2019-10-21 stsp echo "<<<<<<< merged change: commit $orig_commit1" \
221 f69721c3 2019-10-21 stsp > $testroot/content.expected
222 818c7501 2019-07-11 stsp echo "modified alpha on branch" >> $testroot/content.expected
223 f69721c3 2019-10-21 stsp echo "||||||| 3-way merge base: commit $init_commit" \
224 f69721c3 2019-10-21 stsp >> $testroot/content.expected
225 d136cfcb 2019-10-12 stsp echo "alpha" >> $testroot/content.expected
226 818c7501 2019-07-11 stsp echo "=======" >> $testroot/content.expected
227 818c7501 2019-07-11 stsp echo "modified alpha on master" >> $testroot/content.expected
228 f69721c3 2019-10-21 stsp echo '>>>>>>>' >> $testroot/content.expected
229 818c7501 2019-07-11 stsp cat $testroot/wt/alpha > $testroot/content
230 818c7501 2019-07-11 stsp cmp -s $testroot/content.expected $testroot/content
231 818c7501 2019-07-11 stsp ret="$?"
232 818c7501 2019-07-11 stsp if [ "$ret" != "0" ]; then
233 818c7501 2019-07-11 stsp diff -u $testroot/content.expected $testroot/content
234 818c7501 2019-07-11 stsp test_done "$testroot" "$ret"
235 818c7501 2019-07-11 stsp return 1
236 818c7501 2019-07-11 stsp fi
237 818c7501 2019-07-11 stsp
238 818c7501 2019-07-11 stsp (cd $testroot/wt && got status > $testroot/stdout)
239 818c7501 2019-07-11 stsp
240 818c7501 2019-07-11 stsp echo "C alpha" > $testroot/stdout.expected
241 818c7501 2019-07-11 stsp cmp -s $testroot/stdout.expected $testroot/stdout
242 818c7501 2019-07-11 stsp ret="$?"
243 818c7501 2019-07-11 stsp if [ "$ret" != "0" ]; then
244 818c7501 2019-07-11 stsp diff -u $testroot/stdout.expected $testroot/stdout
245 818c7501 2019-07-11 stsp test_done "$testroot" "$ret"
246 818c7501 2019-07-11 stsp return 1
247 818c7501 2019-07-11 stsp fi
248 818c7501 2019-07-11 stsp
249 818c7501 2019-07-11 stsp # resolve the conflict
250 818c7501 2019-07-11 stsp echo "modified alpha on branch and master" > $testroot/wt/alpha
251 818c7501 2019-07-11 stsp
252 f032f1f7 2019-08-04 stsp # test interaction of 'got stage' and rebase -c
253 f032f1f7 2019-08-04 stsp (cd $testroot/wt && got stage alpha > /dev/null)
254 f032f1f7 2019-08-04 stsp (cd $testroot/wt && got rebase -c > $testroot/stdout \
255 f032f1f7 2019-08-04 stsp 2> $testroot/stderr)
256 f032f1f7 2019-08-04 stsp ret="$?"
257 f032f1f7 2019-08-04 stsp if [ "$ret" == "0" ]; then
258 f032f1f7 2019-08-04 stsp echo "rebase succeeded unexpectedly" >&2
259 f032f1f7 2019-08-04 stsp test_done "$testroot" "1"
260 f032f1f7 2019-08-04 stsp return 1
261 f032f1f7 2019-08-04 stsp fi
262 f032f1f7 2019-08-04 stsp echo -n "got: work tree contains files with staged changes; " \
263 f032f1f7 2019-08-04 stsp > $testroot/stderr.expected
264 f032f1f7 2019-08-04 stsp echo "these changes must be committed or unstaged first" \
265 f032f1f7 2019-08-04 stsp >> $testroot/stderr.expected
266 f032f1f7 2019-08-04 stsp cmp -s $testroot/stderr.expected $testroot/stderr
267 f032f1f7 2019-08-04 stsp ret="$?"
268 f032f1f7 2019-08-04 stsp if [ "$ret" != "0" ]; then
269 f032f1f7 2019-08-04 stsp diff -u $testroot/stderr.expected $testroot/stderr
270 f032f1f7 2019-08-04 stsp test_done "$testroot" "$ret"
271 f032f1f7 2019-08-04 stsp return 1
272 f032f1f7 2019-08-04 stsp fi
273 f032f1f7 2019-08-04 stsp
274 f032f1f7 2019-08-04 stsp (cd $testroot/wt && got unstage alpha > /dev/null)
275 818c7501 2019-07-11 stsp (cd $testroot/wt && got rebase -c > $testroot/stdout)
276 818c7501 2019-07-11 stsp
277 818c7501 2019-07-11 stsp (cd $testroot/repo && git checkout -q newbranch)
278 818c7501 2019-07-11 stsp local new_commit1=`git_show_head $testroot/repo`
279 818c7501 2019-07-11 stsp
280 818c7501 2019-07-11 stsp local short_orig_commit1=`trim_obj_id 28 $orig_commit1`
281 818c7501 2019-07-11 stsp local short_new_commit1=`trim_obj_id 28 $new_commit1`
282 818c7501 2019-07-11 stsp
283 818c7501 2019-07-11 stsp echo -n "$short_orig_commit1 -> $short_new_commit1" \
284 818c7501 2019-07-11 stsp > $testroot/stdout.expected
285 818c7501 2019-07-11 stsp echo ": committing to alpha on newbranch" >> $testroot/stdout.expected
286 818c7501 2019-07-11 stsp echo "Switching work tree to refs/heads/newbranch" \
287 818c7501 2019-07-11 stsp >> $testroot/stdout.expected
288 818c7501 2019-07-11 stsp
289 818c7501 2019-07-11 stsp cmp -s $testroot/stdout.expected $testroot/stdout
290 818c7501 2019-07-11 stsp ret="$?"
291 818c7501 2019-07-11 stsp if [ "$ret" != "0" ]; then
292 818c7501 2019-07-11 stsp diff -u $testroot/stdout.expected $testroot/stdout
293 818c7501 2019-07-11 stsp test_done "$testroot" "$ret"
294 818c7501 2019-07-11 stsp return 1
295 818c7501 2019-07-11 stsp fi
296 818c7501 2019-07-11 stsp
297 818c7501 2019-07-11 stsp
298 818c7501 2019-07-11 stsp (cd $testroot/wt && got log -l2 | grep ^commit > $testroot/stdout)
299 818c7501 2019-07-11 stsp echo "commit $new_commit1 (newbranch)" > $testroot/stdout.expected
300 818c7501 2019-07-11 stsp echo "commit $master_commit (master)" >> $testroot/stdout.expected
301 818c7501 2019-07-11 stsp cmp -s $testroot/stdout.expected $testroot/stdout
302 818c7501 2019-07-11 stsp ret="$?"
303 818c7501 2019-07-11 stsp if [ "$ret" != "0" ]; then
304 818c7501 2019-07-11 stsp diff -u $testroot/stdout.expected $testroot/stdout
305 818c7501 2019-07-11 stsp fi
306 818c7501 2019-07-11 stsp test_done "$testroot" "$ret"
307 818c7501 2019-07-11 stsp }
308 818c7501 2019-07-11 stsp
309 818c7501 2019-07-11 stsp function test_rebase_abort {
310 818c7501 2019-07-11 stsp local testroot=`test_init rebase_abort`
311 818c7501 2019-07-11 stsp
312 818c7501 2019-07-11 stsp local init_commit=`git_show_head $testroot/repo`
313 818c7501 2019-07-11 stsp
314 818c7501 2019-07-11 stsp (cd $testroot/repo && git checkout -q -b newbranch)
315 818c7501 2019-07-11 stsp echo "modified alpha on branch" > $testroot/repo/alpha
316 818c7501 2019-07-11 stsp git_commit $testroot/repo -m "committing to alpha on newbranch"
317 818c7501 2019-07-11 stsp local orig_commit1=`git_show_head $testroot/repo`
318 818c7501 2019-07-11 stsp
319 818c7501 2019-07-11 stsp (cd $testroot/repo && git checkout -q master)
320 818c7501 2019-07-11 stsp echo "modified alpha on master" > $testroot/repo/alpha
321 818c7501 2019-07-11 stsp git_commit $testroot/repo -m "committing to alpha on master"
322 818c7501 2019-07-11 stsp local master_commit=`git_show_head $testroot/repo`
323 818c7501 2019-07-11 stsp
324 818c7501 2019-07-11 stsp got checkout $testroot/repo $testroot/wt > /dev/null
325 818c7501 2019-07-11 stsp ret="$?"
326 818c7501 2019-07-11 stsp if [ "$ret" != "0" ]; then
327 818c7501 2019-07-11 stsp test_done "$testroot" "$ret"
328 818c7501 2019-07-11 stsp return 1
329 818c7501 2019-07-11 stsp fi
330 818c7501 2019-07-11 stsp
331 818c7501 2019-07-11 stsp (cd $testroot/wt && got rebase newbranch > $testroot/stdout \
332 818c7501 2019-07-11 stsp 2> $testroot/stderr)
333 818c7501 2019-07-11 stsp
334 818c7501 2019-07-11 stsp echo "C alpha" > $testroot/stdout.expected
335 818c7501 2019-07-11 stsp cmp -s $testroot/stdout.expected $testroot/stdout
336 818c7501 2019-07-11 stsp ret="$?"
337 818c7501 2019-07-11 stsp if [ "$ret" != "0" ]; then
338 818c7501 2019-07-11 stsp diff -u $testroot/stdout.expected $testroot/stdout
339 818c7501 2019-07-11 stsp test_done "$testroot" "$ret"
340 818c7501 2019-07-11 stsp return 1
341 818c7501 2019-07-11 stsp fi
342 818c7501 2019-07-11 stsp
343 11495e04 2019-07-12 stsp echo "got: conflicts must be resolved before rebasing can continue" \
344 818c7501 2019-07-11 stsp > $testroot/stderr.expected
345 818c7501 2019-07-11 stsp cmp -s $testroot/stderr.expected $testroot/stderr
346 818c7501 2019-07-11 stsp ret="$?"
347 818c7501 2019-07-11 stsp if [ "$ret" != "0" ]; then
348 818c7501 2019-07-11 stsp diff -u $testroot/stderr.expected $testroot/stderr
349 818c7501 2019-07-11 stsp test_done "$testroot" "$ret"
350 818c7501 2019-07-11 stsp return 1
351 818c7501 2019-07-11 stsp fi
352 818c7501 2019-07-11 stsp
353 f69721c3 2019-10-21 stsp echo "<<<<<<< merged change: commit $orig_commit1" \
354 f69721c3 2019-10-21 stsp > $testroot/content.expected
355 818c7501 2019-07-11 stsp echo "modified alpha on branch" >> $testroot/content.expected
356 f69721c3 2019-10-21 stsp echo "||||||| 3-way merge base: commit $init_commit" \
357 f69721c3 2019-10-21 stsp >> $testroot/content.expected
358 d136cfcb 2019-10-12 stsp echo "alpha" >> $testroot/content.expected
359 818c7501 2019-07-11 stsp echo "=======" >> $testroot/content.expected
360 818c7501 2019-07-11 stsp echo "modified alpha on master" >> $testroot/content.expected
361 f69721c3 2019-10-21 stsp echo '>>>>>>>' >> $testroot/content.expected
362 818c7501 2019-07-11 stsp cat $testroot/wt/alpha > $testroot/content
363 818c7501 2019-07-11 stsp cmp -s $testroot/content.expected $testroot/content
364 818c7501 2019-07-11 stsp ret="$?"
365 818c7501 2019-07-11 stsp if [ "$ret" != "0" ]; then
366 818c7501 2019-07-11 stsp diff -u $testroot/content.expected $testroot/content
367 818c7501 2019-07-11 stsp test_done "$testroot" "$ret"
368 818c7501 2019-07-11 stsp return 1
369 818c7501 2019-07-11 stsp fi
370 818c7501 2019-07-11 stsp
371 818c7501 2019-07-11 stsp (cd $testroot/wt && got status > $testroot/stdout)
372 818c7501 2019-07-11 stsp
373 818c7501 2019-07-11 stsp echo "C alpha" > $testroot/stdout.expected
374 818c7501 2019-07-11 stsp cmp -s $testroot/stdout.expected $testroot/stdout
375 818c7501 2019-07-11 stsp ret="$?"
376 818c7501 2019-07-11 stsp if [ "$ret" != "0" ]; then
377 818c7501 2019-07-11 stsp diff -u $testroot/stdout.expected $testroot/stdout
378 818c7501 2019-07-11 stsp test_done "$testroot" "$ret"
379 818c7501 2019-07-11 stsp return 1
380 818c7501 2019-07-11 stsp fi
381 818c7501 2019-07-11 stsp
382 818c7501 2019-07-11 stsp (cd $testroot/wt && got rebase -a > $testroot/stdout)
383 818c7501 2019-07-11 stsp
384 818c7501 2019-07-11 stsp (cd $testroot/repo && git checkout -q newbranch)
385 818c7501 2019-07-11 stsp
386 818c7501 2019-07-11 stsp echo "Switching work tree to refs/heads/master" \
387 818c7501 2019-07-11 stsp > $testroot/stdout.expected
388 818c7501 2019-07-11 stsp echo 'R alpha' >> $testroot/stdout.expected
389 818c7501 2019-07-11 stsp echo "Rebase of refs/heads/newbranch aborted" \
390 818c7501 2019-07-11 stsp >> $testroot/stdout.expected
391 818c7501 2019-07-11 stsp
392 818c7501 2019-07-11 stsp cmp -s $testroot/stdout.expected $testroot/stdout
393 818c7501 2019-07-11 stsp ret="$?"
394 818c7501 2019-07-11 stsp if [ "$ret" != "0" ]; then
395 818c7501 2019-07-11 stsp diff -u $testroot/stdout.expected $testroot/stdout
396 818c7501 2019-07-11 stsp test_done "$testroot" "$ret"
397 818c7501 2019-07-11 stsp return 1
398 818c7501 2019-07-11 stsp fi
399 818c7501 2019-07-11 stsp
400 818c7501 2019-07-11 stsp echo "modified alpha on master" > $testroot/content.expected
401 818c7501 2019-07-11 stsp cat $testroot/wt/alpha > $testroot/content
402 818c7501 2019-07-11 stsp cmp -s $testroot/content.expected $testroot/content
403 818c7501 2019-07-11 stsp ret="$?"
404 818c7501 2019-07-11 stsp if [ "$ret" != "0" ]; then
405 818c7501 2019-07-11 stsp diff -u $testroot/content.expected $testroot/content
406 818c7501 2019-07-11 stsp test_done "$testroot" "$ret"
407 818c7501 2019-07-11 stsp return 1
408 818c7501 2019-07-11 stsp fi
409 818c7501 2019-07-11 stsp
410 818c7501 2019-07-11 stsp (cd $testroot/wt && got log -l3 -c newbranch \
411 818c7501 2019-07-11 stsp | grep ^commit > $testroot/stdout)
412 818c7501 2019-07-11 stsp echo "commit $orig_commit1 (newbranch)" > $testroot/stdout.expected
413 818c7501 2019-07-11 stsp echo "commit $init_commit" >> $testroot/stdout.expected
414 818c7501 2019-07-11 stsp cmp -s $testroot/stdout.expected $testroot/stdout
415 818c7501 2019-07-11 stsp ret="$?"
416 818c7501 2019-07-11 stsp if [ "$ret" != "0" ]; then
417 818c7501 2019-07-11 stsp diff -u $testroot/stdout.expected $testroot/stdout
418 818c7501 2019-07-11 stsp fi
419 818c7501 2019-07-11 stsp test_done "$testroot" "$ret"
420 818c7501 2019-07-11 stsp }
421 818c7501 2019-07-11 stsp
422 ff0d2220 2019-07-11 stsp function test_rebase_no_op_change {
423 ff0d2220 2019-07-11 stsp local testroot=`test_init rebase_no_op_change`
424 ff0d2220 2019-07-11 stsp local init_commit=`git_show_head $testroot/repo`
425 ff0d2220 2019-07-11 stsp
426 ff0d2220 2019-07-11 stsp (cd $testroot/repo && git checkout -q -b newbranch)
427 ff0d2220 2019-07-11 stsp echo "modified alpha on branch" > $testroot/repo/alpha
428 ff0d2220 2019-07-11 stsp git_commit $testroot/repo -m "committing to alpha on newbranch"
429 ff0d2220 2019-07-11 stsp local orig_commit1=`git_show_head $testroot/repo`
430 ff0d2220 2019-07-11 stsp
431 ff0d2220 2019-07-11 stsp (cd $testroot/repo && git checkout -q master)
432 ff0d2220 2019-07-11 stsp echo "modified alpha on master" > $testroot/repo/alpha
433 ff0d2220 2019-07-11 stsp git_commit $testroot/repo -m "committing to alpha on master"
434 ff0d2220 2019-07-11 stsp local master_commit=`git_show_head $testroot/repo`
435 ff0d2220 2019-07-11 stsp
436 ff0d2220 2019-07-11 stsp got checkout $testroot/repo $testroot/wt > /dev/null
437 ff0d2220 2019-07-11 stsp ret="$?"
438 ff0d2220 2019-07-11 stsp if [ "$ret" != "0" ]; then
439 ff0d2220 2019-07-11 stsp test_done "$testroot" "$ret"
440 ff0d2220 2019-07-11 stsp return 1
441 ff0d2220 2019-07-11 stsp fi
442 ff0d2220 2019-07-11 stsp
443 ff0d2220 2019-07-11 stsp (cd $testroot/wt && got rebase newbranch > $testroot/stdout \
444 ff0d2220 2019-07-11 stsp 2> $testroot/stderr)
445 ff0d2220 2019-07-11 stsp
446 ff0d2220 2019-07-11 stsp echo "C alpha" > $testroot/stdout.expected
447 ff0d2220 2019-07-11 stsp cmp -s $testroot/stdout.expected $testroot/stdout
448 ff0d2220 2019-07-11 stsp ret="$?"
449 ff0d2220 2019-07-11 stsp if [ "$ret" != "0" ]; then
450 ff0d2220 2019-07-11 stsp diff -u $testroot/stdout.expected $testroot/stdout
451 ff0d2220 2019-07-11 stsp test_done "$testroot" "$ret"
452 ff0d2220 2019-07-11 stsp return 1
453 ff0d2220 2019-07-11 stsp fi
454 ff0d2220 2019-07-11 stsp
455 11495e04 2019-07-12 stsp echo "got: conflicts must be resolved before rebasing can continue" \
456 ff0d2220 2019-07-11 stsp > $testroot/stderr.expected
457 ff0d2220 2019-07-11 stsp cmp -s $testroot/stderr.expected $testroot/stderr
458 ff0d2220 2019-07-11 stsp ret="$?"
459 ff0d2220 2019-07-11 stsp if [ "$ret" != "0" ]; then
460 ff0d2220 2019-07-11 stsp diff -u $testroot/stderr.expected $testroot/stderr
461 ff0d2220 2019-07-11 stsp test_done "$testroot" "$ret"
462 ff0d2220 2019-07-11 stsp return 1
463 ff0d2220 2019-07-11 stsp fi
464 ff0d2220 2019-07-11 stsp
465 f69721c3 2019-10-21 stsp echo "<<<<<<< merged change: commit $orig_commit1" \
466 f69721c3 2019-10-21 stsp > $testroot/content.expected
467 ff0d2220 2019-07-11 stsp echo "modified alpha on branch" >> $testroot/content.expected
468 f69721c3 2019-10-21 stsp echo "||||||| 3-way merge base: commit $init_commit" \
469 f69721c3 2019-10-21 stsp >> $testroot/content.expected
470 d136cfcb 2019-10-12 stsp echo "alpha" >> $testroot/content.expected
471 ff0d2220 2019-07-11 stsp echo "=======" >> $testroot/content.expected
472 ff0d2220 2019-07-11 stsp echo "modified alpha on master" >> $testroot/content.expected
473 f69721c3 2019-10-21 stsp echo '>>>>>>>' >> $testroot/content.expected
474 ff0d2220 2019-07-11 stsp cat $testroot/wt/alpha > $testroot/content
475 ff0d2220 2019-07-11 stsp cmp -s $testroot/content.expected $testroot/content
476 ff0d2220 2019-07-11 stsp ret="$?"
477 ff0d2220 2019-07-11 stsp if [ "$ret" != "0" ]; then
478 ff0d2220 2019-07-11 stsp diff -u $testroot/content.expected $testroot/content
479 ff0d2220 2019-07-11 stsp test_done "$testroot" "$ret"
480 ff0d2220 2019-07-11 stsp return 1
481 ff0d2220 2019-07-11 stsp fi
482 ff0d2220 2019-07-11 stsp
483 ff0d2220 2019-07-11 stsp (cd $testroot/wt && got status > $testroot/stdout)
484 ff0d2220 2019-07-11 stsp
485 ff0d2220 2019-07-11 stsp echo "C alpha" > $testroot/stdout.expected
486 ff0d2220 2019-07-11 stsp cmp -s $testroot/stdout.expected $testroot/stdout
487 ff0d2220 2019-07-11 stsp ret="$?"
488 ff0d2220 2019-07-11 stsp if [ "$ret" != "0" ]; then
489 ff0d2220 2019-07-11 stsp diff -u $testroot/stdout.expected $testroot/stdout
490 ff0d2220 2019-07-11 stsp test_done "$testroot" "$ret"
491 ff0d2220 2019-07-11 stsp return 1
492 ff0d2220 2019-07-11 stsp fi
493 ff0d2220 2019-07-11 stsp
494 ff0d2220 2019-07-11 stsp # resolve the conflict
495 ff0d2220 2019-07-11 stsp echo "modified alpha on master" > $testroot/wt/alpha
496 ff0d2220 2019-07-11 stsp
497 ff0d2220 2019-07-11 stsp (cd $testroot/wt && got rebase -c > $testroot/stdout)
498 ff0d2220 2019-07-11 stsp
499 ff0d2220 2019-07-11 stsp (cd $testroot/repo && git checkout -q newbranch)
500 ff0d2220 2019-07-11 stsp local new_commit1=`git_show_head $testroot/repo`
501 ff0d2220 2019-07-11 stsp
502 ff0d2220 2019-07-11 stsp local short_orig_commit1=`trim_obj_id 28 $orig_commit1`
503 ff0d2220 2019-07-11 stsp
504 ff0d2220 2019-07-11 stsp echo -n "$short_orig_commit1 -> no-op change" \
505 ff0d2220 2019-07-11 stsp > $testroot/stdout.expected
506 ff0d2220 2019-07-11 stsp echo ": committing to alpha on newbranch" >> $testroot/stdout.expected
507 ff0d2220 2019-07-11 stsp echo "Switching work tree to refs/heads/newbranch" \
508 ff0d2220 2019-07-11 stsp >> $testroot/stdout.expected
509 ff0d2220 2019-07-11 stsp
510 ff0d2220 2019-07-11 stsp cmp -s $testroot/stdout.expected $testroot/stdout
511 ff0d2220 2019-07-11 stsp ret="$?"
512 ff0d2220 2019-07-11 stsp if [ "$ret" != "0" ]; then
513 ff0d2220 2019-07-11 stsp diff -u $testroot/stdout.expected $testroot/stdout
514 ff0d2220 2019-07-11 stsp test_done "$testroot" "$ret"
515 ff0d2220 2019-07-11 stsp return 1
516 ff0d2220 2019-07-11 stsp fi
517 ff0d2220 2019-07-11 stsp
518 ff0d2220 2019-07-11 stsp
519 ff0d2220 2019-07-11 stsp (cd $testroot/wt && got log -l2 | grep ^commit > $testroot/stdout)
520 ff0d2220 2019-07-11 stsp echo "commit $master_commit (master, newbranch)" \
521 ff0d2220 2019-07-11 stsp > $testroot/stdout.expected
522 ff0d2220 2019-07-11 stsp echo "commit $init_commit" >> $testroot/stdout.expected
523 7d5807f4 2019-07-11 stsp cmp -s $testroot/stdout.expected $testroot/stdout
524 7d5807f4 2019-07-11 stsp ret="$?"
525 7d5807f4 2019-07-11 stsp if [ "$ret" != "0" ]; then
526 7d5807f4 2019-07-11 stsp diff -u $testroot/stdout.expected $testroot/stdout
527 7d5807f4 2019-07-11 stsp fi
528 7d5807f4 2019-07-11 stsp test_done "$testroot" "$ret"
529 7d5807f4 2019-07-11 stsp }
530 7d5807f4 2019-07-11 stsp
531 7d5807f4 2019-07-11 stsp function test_rebase_in_progress {
532 4ba9c4f6 2019-07-11 stsp local testroot=`test_init rebase_in_progress`
533 7d5807f4 2019-07-11 stsp local init_commit=`git_show_head $testroot/repo`
534 7d5807f4 2019-07-11 stsp
535 7d5807f4 2019-07-11 stsp (cd $testroot/repo && git checkout -q -b newbranch)
536 7d5807f4 2019-07-11 stsp echo "modified alpha on branch" > $testroot/repo/alpha
537 7d5807f4 2019-07-11 stsp git_commit $testroot/repo -m "committing to alpha on newbranch"
538 7d5807f4 2019-07-11 stsp local orig_commit1=`git_show_head $testroot/repo`
539 7d5807f4 2019-07-11 stsp
540 7d5807f4 2019-07-11 stsp (cd $testroot/repo && git checkout -q master)
541 7d5807f4 2019-07-11 stsp echo "modified alpha on master" > $testroot/repo/alpha
542 7d5807f4 2019-07-11 stsp git_commit $testroot/repo -m "committing to alpha on master"
543 7d5807f4 2019-07-11 stsp local master_commit=`git_show_head $testroot/repo`
544 7d5807f4 2019-07-11 stsp
545 7d5807f4 2019-07-11 stsp got checkout $testroot/repo $testroot/wt > /dev/null
546 7d5807f4 2019-07-11 stsp ret="$?"
547 7d5807f4 2019-07-11 stsp if [ "$ret" != "0" ]; then
548 7d5807f4 2019-07-11 stsp test_done "$testroot" "$ret"
549 7d5807f4 2019-07-11 stsp return 1
550 7d5807f4 2019-07-11 stsp fi
551 7d5807f4 2019-07-11 stsp
552 7d5807f4 2019-07-11 stsp (cd $testroot/wt && got rebase newbranch > $testroot/stdout \
553 7d5807f4 2019-07-11 stsp 2> $testroot/stderr)
554 7d5807f4 2019-07-11 stsp
555 7d5807f4 2019-07-11 stsp echo "C alpha" > $testroot/stdout.expected
556 7d5807f4 2019-07-11 stsp cmp -s $testroot/stdout.expected $testroot/stdout
557 7d5807f4 2019-07-11 stsp ret="$?"
558 7d5807f4 2019-07-11 stsp if [ "$ret" != "0" ]; then
559 7d5807f4 2019-07-11 stsp diff -u $testroot/stdout.expected $testroot/stdout
560 7d5807f4 2019-07-11 stsp test_done "$testroot" "$ret"
561 7d5807f4 2019-07-11 stsp return 1
562 7d5807f4 2019-07-11 stsp fi
563 7d5807f4 2019-07-11 stsp
564 11495e04 2019-07-12 stsp echo "got: conflicts must be resolved before rebasing can continue" \
565 7d5807f4 2019-07-11 stsp > $testroot/stderr.expected
566 7d5807f4 2019-07-11 stsp cmp -s $testroot/stderr.expected $testroot/stderr
567 7d5807f4 2019-07-11 stsp ret="$?"
568 7d5807f4 2019-07-11 stsp if [ "$ret" != "0" ]; then
569 7d5807f4 2019-07-11 stsp diff -u $testroot/stderr.expected $testroot/stderr
570 7d5807f4 2019-07-11 stsp test_done "$testroot" "$ret"
571 7d5807f4 2019-07-11 stsp return 1
572 7d5807f4 2019-07-11 stsp fi
573 7d5807f4 2019-07-11 stsp
574 f69721c3 2019-10-21 stsp echo "<<<<<<< merged change: commit $orig_commit1" \
575 f69721c3 2019-10-21 stsp > $testroot/content.expected
576 7d5807f4 2019-07-11 stsp echo "modified alpha on branch" >> $testroot/content.expected
577 f69721c3 2019-10-21 stsp echo "||||||| 3-way merge base: commit $init_commit" \
578 f69721c3 2019-10-21 stsp >> $testroot/content.expected
579 d136cfcb 2019-10-12 stsp echo "alpha" >> $testroot/content.expected
580 7d5807f4 2019-07-11 stsp echo "=======" >> $testroot/content.expected
581 7d5807f4 2019-07-11 stsp echo "modified alpha on master" >> $testroot/content.expected
582 f69721c3 2019-10-21 stsp echo '>>>>>>>' >> $testroot/content.expected
583 7d5807f4 2019-07-11 stsp cat $testroot/wt/alpha > $testroot/content
584 7d5807f4 2019-07-11 stsp cmp -s $testroot/content.expected $testroot/content
585 7d5807f4 2019-07-11 stsp ret="$?"
586 7d5807f4 2019-07-11 stsp if [ "$ret" != "0" ]; then
587 7d5807f4 2019-07-11 stsp diff -u $testroot/content.expected $testroot/content
588 7d5807f4 2019-07-11 stsp test_done "$testroot" "$ret"
589 7d5807f4 2019-07-11 stsp return 1
590 7d5807f4 2019-07-11 stsp fi
591 7d5807f4 2019-07-11 stsp
592 7d5807f4 2019-07-11 stsp (cd $testroot/wt && got status > $testroot/stdout)
593 7d5807f4 2019-07-11 stsp
594 7d5807f4 2019-07-11 stsp echo "C alpha" > $testroot/stdout.expected
595 ff0d2220 2019-07-11 stsp cmp -s $testroot/stdout.expected $testroot/stdout
596 ff0d2220 2019-07-11 stsp ret="$?"
597 ff0d2220 2019-07-11 stsp if [ "$ret" != "0" ]; then
598 ff0d2220 2019-07-11 stsp diff -u $testroot/stdout.expected $testroot/stdout
599 7d5807f4 2019-07-11 stsp test_done "$testroot" "$ret"
600 7d5807f4 2019-07-11 stsp return 1
601 ff0d2220 2019-07-11 stsp fi
602 7d5807f4 2019-07-11 stsp
603 7d5807f4 2019-07-11 stsp for cmd in update commit; do
604 7d5807f4 2019-07-11 stsp (cd $testroot/wt && got $cmd > $testroot/stdout \
605 7d5807f4 2019-07-11 stsp 2> $testroot/stderr)
606 7d5807f4 2019-07-11 stsp
607 7d5807f4 2019-07-11 stsp echo -n > $testroot/stdout.expected
608 7d5807f4 2019-07-11 stsp cmp -s $testroot/stdout.expected $testroot/stdout
609 7d5807f4 2019-07-11 stsp ret="$?"
610 7d5807f4 2019-07-11 stsp if [ "$ret" != "0" ]; then
611 7d5807f4 2019-07-11 stsp diff -u $testroot/stdout.expected $testroot/stdout
612 7d5807f4 2019-07-11 stsp test_done "$testroot" "$ret"
613 7d5807f4 2019-07-11 stsp return 1
614 7d5807f4 2019-07-11 stsp fi
615 7d5807f4 2019-07-11 stsp
616 7d5807f4 2019-07-11 stsp echo -n "got: a rebase operation is in progress in this " \
617 7d5807f4 2019-07-11 stsp > $testroot/stderr.expected
618 7d5807f4 2019-07-11 stsp echo "work tree and must be continued or aborted first" \
619 7d5807f4 2019-07-11 stsp >> $testroot/stderr.expected
620 7d5807f4 2019-07-11 stsp cmp -s $testroot/stderr.expected $testroot/stderr
621 7d5807f4 2019-07-11 stsp ret="$?"
622 7d5807f4 2019-07-11 stsp if [ "$ret" != "0" ]; then
623 7d5807f4 2019-07-11 stsp diff -u $testroot/stderr.expected $testroot/stderr
624 7d5807f4 2019-07-11 stsp test_done "$testroot" "$ret"
625 7d5807f4 2019-07-11 stsp return 1
626 7d5807f4 2019-07-11 stsp fi
627 7d5807f4 2019-07-11 stsp done
628 64c6d990 2019-07-11 stsp
629 64c6d990 2019-07-11 stsp test_done "$testroot" "$ret"
630 64c6d990 2019-07-11 stsp }
631 64c6d990 2019-07-11 stsp
632 64c6d990 2019-07-11 stsp function test_rebase_path_prefix {
633 64c6d990 2019-07-11 stsp local testroot=`test_init rebase_path_prefix`
634 64c6d990 2019-07-11 stsp
635 64c6d990 2019-07-11 stsp (cd $testroot/repo && git checkout -q -b newbranch)
636 64c6d990 2019-07-11 stsp echo "modified delta on branch" > $testroot/repo/gamma/delta
637 64c6d990 2019-07-11 stsp git_commit $testroot/repo -m "committing to delta on newbranch"
638 64c6d990 2019-07-11 stsp
639 64c6d990 2019-07-11 stsp local orig_commit1=`git_show_parent_commit $testroot/repo`
640 64c6d990 2019-07-11 stsp local orig_commit2=`git_show_head $testroot/repo`
641 64c6d990 2019-07-11 stsp
642 64c6d990 2019-07-11 stsp (cd $testroot/repo && git checkout -q master)
643 64c6d990 2019-07-11 stsp echo "modified zeta on master" > $testroot/repo/epsilon/zeta
644 64c6d990 2019-07-11 stsp git_commit $testroot/repo -m "committing to zeta on master"
645 64c6d990 2019-07-11 stsp local master_commit=`git_show_head $testroot/repo`
646 64c6d990 2019-07-11 stsp
647 64c6d990 2019-07-11 stsp got checkout -p epsilon $testroot/repo $testroot/wt > /dev/null
648 64c6d990 2019-07-11 stsp ret="$?"
649 64c6d990 2019-07-11 stsp if [ "$ret" != "0" ]; then
650 64c6d990 2019-07-11 stsp test_done "$testroot" "$ret"
651 64c6d990 2019-07-11 stsp return 1
652 64c6d990 2019-07-11 stsp fi
653 7d5807f4 2019-07-11 stsp
654 64c6d990 2019-07-11 stsp (cd $testroot/wt && got rebase newbranch \
655 64c6d990 2019-07-11 stsp > $testroot/stdout 2> $testroot/stderr)
656 64c6d990 2019-07-11 stsp
657 64c6d990 2019-07-11 stsp echo -n > $testroot/stdout.expected
658 64c6d990 2019-07-11 stsp cmp -s $testroot/stdout.expected $testroot/stdout
659 64c6d990 2019-07-11 stsp ret="$?"
660 64c6d990 2019-07-11 stsp if [ "$ret" != "0" ]; then
661 64c6d990 2019-07-11 stsp diff -u $testroot/stdout.expected $testroot/stdout
662 64c6d990 2019-07-11 stsp test_done "$testroot" "$ret"
663 64c6d990 2019-07-11 stsp return 1
664 64c6d990 2019-07-11 stsp fi
665 64c6d990 2019-07-11 stsp
666 64c6d990 2019-07-11 stsp echo -n "got: cannot rebase branch which contains changes outside " \
667 64c6d990 2019-07-11 stsp > $testroot/stderr.expected
668 64c6d990 2019-07-11 stsp echo "of this work tree's path prefix" >> $testroot/stderr.expected
669 787c8eb6 2019-07-11 stsp cmp -s $testroot/stderr.expected $testroot/stderr
670 787c8eb6 2019-07-11 stsp ret="$?"
671 787c8eb6 2019-07-11 stsp if [ "$ret" != "0" ]; then
672 787c8eb6 2019-07-11 stsp diff -u $testroot/stderr.expected $testroot/stderr
673 787c8eb6 2019-07-11 stsp fi
674 787c8eb6 2019-07-11 stsp test_done "$testroot" "$ret"
675 787c8eb6 2019-07-11 stsp }
676 787c8eb6 2019-07-11 stsp
677 787c8eb6 2019-07-11 stsp function test_rebase_preserves_logmsg {
678 787c8eb6 2019-07-11 stsp local testroot=`test_init rebase_preserves_logmsg`
679 787c8eb6 2019-07-11 stsp
680 787c8eb6 2019-07-11 stsp (cd $testroot/repo && git checkout -q -b newbranch)
681 787c8eb6 2019-07-11 stsp echo "modified delta on branch" > $testroot/repo/gamma/delta
682 787c8eb6 2019-07-11 stsp git_commit $testroot/repo -m "modified delta on newbranch"
683 787c8eb6 2019-07-11 stsp
684 787c8eb6 2019-07-11 stsp echo "modified alpha on branch" > $testroot/repo/alpha
685 787c8eb6 2019-07-11 stsp git_commit $testroot/repo -m "modified alpha on newbranch"
686 787c8eb6 2019-07-11 stsp
687 787c8eb6 2019-07-11 stsp (cd $testroot/repo && got log -c newbranch -l2 | grep -v ^date: \
688 787c8eb6 2019-07-11 stsp > $testroot/log.expected)
689 787c8eb6 2019-07-11 stsp
690 787c8eb6 2019-07-11 stsp local orig_commit1=`git_show_parent_commit $testroot/repo`
691 787c8eb6 2019-07-11 stsp local orig_commit2=`git_show_head $testroot/repo`
692 787c8eb6 2019-07-11 stsp
693 787c8eb6 2019-07-11 stsp (cd $testroot/repo && git checkout -q master)
694 787c8eb6 2019-07-11 stsp echo "modified zeta on master" > $testroot/repo/epsilon/zeta
695 787c8eb6 2019-07-11 stsp git_commit $testroot/repo -m "committing to zeta on master"
696 787c8eb6 2019-07-11 stsp local master_commit=`git_show_head $testroot/repo`
697 787c8eb6 2019-07-11 stsp
698 787c8eb6 2019-07-11 stsp got checkout $testroot/repo $testroot/wt > /dev/null
699 787c8eb6 2019-07-11 stsp ret="$?"
700 787c8eb6 2019-07-11 stsp if [ "$ret" != "0" ]; then
701 787c8eb6 2019-07-11 stsp test_done "$testroot" "$ret"
702 787c8eb6 2019-07-11 stsp return 1
703 787c8eb6 2019-07-11 stsp fi
704 787c8eb6 2019-07-11 stsp
705 787c8eb6 2019-07-11 stsp (cd $testroot/wt && got rebase newbranch > /dev/null \
706 787c8eb6 2019-07-11 stsp 2> $testroot/stderr)
707 787c8eb6 2019-07-11 stsp
708 787c8eb6 2019-07-11 stsp (cd $testroot/repo && git checkout -q newbranch)
709 787c8eb6 2019-07-11 stsp local new_commit1=`git_show_parent_commit $testroot/repo`
710 787c8eb6 2019-07-11 stsp local new_commit2=`git_show_head $testroot/repo`
711 787c8eb6 2019-07-11 stsp
712 787c8eb6 2019-07-11 stsp echo -n > $testroot/stderr.expected
713 64c6d990 2019-07-11 stsp cmp -s $testroot/stderr.expected $testroot/stderr
714 64c6d990 2019-07-11 stsp ret="$?"
715 64c6d990 2019-07-11 stsp if [ "$ret" != "0" ]; then
716 64c6d990 2019-07-11 stsp diff -u $testroot/stderr.expected $testroot/stderr
717 787c8eb6 2019-07-11 stsp test_done "$testroot" "$ret"
718 787c8eb6 2019-07-11 stsp return 1
719 64c6d990 2019-07-11 stsp fi
720 787c8eb6 2019-07-11 stsp
721 787c8eb6 2019-07-11 stsp (cd $testroot/wt && got log -c newbranch -l2 | grep -v ^date: \
722 787c8eb6 2019-07-11 stsp > $testroot/log)
723 787c8eb6 2019-07-11 stsp sed -i -e "s/$orig_commit1/$new_commit1/" $testroot/log.expected
724 787c8eb6 2019-07-11 stsp sed -i -e "s/$orig_commit2/$new_commit2/" $testroot/log.expected
725 787c8eb6 2019-07-11 stsp cmp -s $testroot/log.expected $testroot/log
726 787c8eb6 2019-07-11 stsp ret="$?"
727 787c8eb6 2019-07-11 stsp if [ "$ret" != "0" ]; then
728 787c8eb6 2019-07-11 stsp diff -u $testroot/log.expected $testroot/log
729 fc66b545 2019-08-12 stsp fi
730 fc66b545 2019-08-12 stsp
731 fc66b545 2019-08-12 stsp test_done "$testroot" "$ret"
732 fc66b545 2019-08-12 stsp }
733 fc66b545 2019-08-12 stsp
734 fc66b545 2019-08-12 stsp function test_rebase_no_commits_to_rebase {
735 fc66b545 2019-08-12 stsp local testroot=`test_init rebase_no_commits_to_rebase`
736 fc66b545 2019-08-12 stsp
737 fc66b545 2019-08-12 stsp got checkout $testroot/repo $testroot/wt > /dev/null
738 fc66b545 2019-08-12 stsp ret="$?"
739 fc66b545 2019-08-12 stsp if [ "$ret" != "0" ]; then
740 fc66b545 2019-08-12 stsp test_done "$testroot" "$ret"
741 fc66b545 2019-08-12 stsp return 1
742 fc66b545 2019-08-12 stsp fi
743 fc66b545 2019-08-12 stsp
744 fc66b545 2019-08-12 stsp (cd $testroot/wt && got branch newbranch)
745 fc66b545 2019-08-12 stsp
746 fc66b545 2019-08-12 stsp echo "modified alpha on master" > $testroot/wt/alpha
747 fc66b545 2019-08-12 stsp (cd $testroot/wt && got commit -m 'test rebase_no_commits_to_rebase' \
748 fc66b545 2019-08-12 stsp > /dev/null)
749 fc66b545 2019-08-12 stsp (cd $testroot/wt && got update > /dev/null)
750 fc66b545 2019-08-12 stsp
751 fc66b545 2019-08-12 stsp (cd $testroot/wt && got rebase newbranch > $testroot/stdout \
752 fc66b545 2019-08-12 stsp 2> $testroot/stderr)
753 fc66b545 2019-08-12 stsp
754 fc66b545 2019-08-12 stsp echo "got: no commits to rebase" > $testroot/stderr.expected
755 fc66b545 2019-08-12 stsp cmp -s $testroot/stderr.expected $testroot/stderr
756 fc66b545 2019-08-12 stsp ret="$?"
757 fc66b545 2019-08-12 stsp if [ "$ret" != "0" ]; then
758 fc66b545 2019-08-12 stsp diff -u $testroot/stderr.expected $testroot/stderr
759 fc66b545 2019-08-12 stsp test_done "$testroot" "$ret"
760 fc66b545 2019-08-12 stsp return 1
761 787c8eb6 2019-07-11 stsp fi
762 787c8eb6 2019-07-11 stsp
763 fc66b545 2019-08-12 stsp echo "Rebase of refs/heads/newbranch aborted" \
764 fc66b545 2019-08-12 stsp > $testroot/stdout.expected
765 fc66b545 2019-08-12 stsp cmp -s $testroot/stdout.expected $testroot/stdout
766 fc66b545 2019-08-12 stsp ret="$?"
767 fc66b545 2019-08-12 stsp if [ "$ret" != "0" ]; then
768 fc66b545 2019-08-12 stsp diff -u $testroot/stdout.expected $testroot/stdout
769 fc66b545 2019-08-12 stsp test_done "$testroot" "$ret"
770 fc66b545 2019-08-12 stsp return 1
771 fc66b545 2019-08-12 stsp fi
772 fc66b545 2019-08-12 stsp
773 fc66b545 2019-08-12 stsp (cd $testroot/wt && got update > $testroot/stdout)
774 fc66b545 2019-08-12 stsp echo "Already up-to-date" > $testroot/stdout.expected
775 fc66b545 2019-08-12 stsp cmp -s $testroot/stdout.expected $testroot/stdout
776 fc66b545 2019-08-12 stsp ret="$?"
777 fc66b545 2019-08-12 stsp if [ "$ret" != "0" ]; then
778 fc66b545 2019-08-12 stsp diff -u $testroot/stdout.expected $testroot/stdout
779 fc66b545 2019-08-12 stsp fi
780 ff0d2220 2019-07-11 stsp test_done "$testroot" "$ret"
781 ff0d2220 2019-07-11 stsp }
782 38b0338b 2019-11-29 stsp
783 38b0338b 2019-11-29 stsp function test_rebase_forward {
784 38b0338b 2019-11-29 stsp local testroot=`test_init rebase_forward`
785 38b0338b 2019-11-29 stsp local commit0=`git_show_head $testroot/repo`
786 38b0338b 2019-11-29 stsp
787 38b0338b 2019-11-29 stsp got checkout $testroot/repo $testroot/wt > /dev/null
788 38b0338b 2019-11-29 stsp ret="$?"
789 38b0338b 2019-11-29 stsp if [ "$ret" != "0" ]; then
790 38b0338b 2019-11-29 stsp test_done "$testroot" "$ret"
791 38b0338b 2019-11-29 stsp return 1
792 38b0338b 2019-11-29 stsp fi
793 38b0338b 2019-11-29 stsp
794 38b0338b 2019-11-29 stsp echo "change alpha 1" > $testroot/wt/alpha
795 38b0338b 2019-11-29 stsp (cd $testroot/wt && got commit -m 'test rebase_forward' \
796 38b0338b 2019-11-29 stsp > /dev/null)
797 38b0338b 2019-11-29 stsp local commit1=`git_show_head $testroot/repo`
798 ff0d2220 2019-07-11 stsp
799 38b0338b 2019-11-29 stsp echo "change alpha 2" > $testroot/wt/alpha
800 38b0338b 2019-11-29 stsp (cd $testroot/wt && got commit -m 'test rebase_forward' \
801 38b0338b 2019-11-29 stsp > /dev/null)
802 38b0338b 2019-11-29 stsp local commit2=`git_show_head $testroot/repo`
803 38b0338b 2019-11-29 stsp
804 38b0338b 2019-11-29 stsp # Simulate a situation where fast-forward is required.
805 38b0338b 2019-11-29 stsp # We want to fast-forward master to origin/master:
806 38b0338b 2019-11-29 stsp # commit 3907e11dceaae2ca7f8db79c2af31794673945ad (origin/master)
807 38b0338b 2019-11-29 stsp # commit ffcffcd102cf1af6572fbdbb4cf07a0f1fd2d840 (master)
808 38b0338b 2019-11-29 stsp # commit 87a6a8a2263a15b61c016ff1720b24741d455eb5
809 38b0338b 2019-11-29 stsp (cd $testroot/repo && got ref -d master)
810 38b0338b 2019-11-29 stsp (cd $testroot/repo && got ref refs/heads/master $commit1)
811 38b0338b 2019-11-29 stsp (cd $testroot/repo && got ref refs/remotes/origin/master $commit2)
812 38b0338b 2019-11-29 stsp
813 38b0338b 2019-11-29 stsp
814 38b0338b 2019-11-29 stsp (cd $testroot/wt && got up -b origin/master > /dev/null)
815 38b0338b 2019-11-29 stsp
816 38b0338b 2019-11-29 stsp (cd $testroot/wt && got rebase master \
817 38b0338b 2019-11-29 stsp > $testroot/stdout 2> $testroot/stderr)
818 38b0338b 2019-11-29 stsp
819 38b0338b 2019-11-29 stsp echo "Forwarding refs/heads/master to commit $commit2" \
820 38b0338b 2019-11-29 stsp > $testroot/stdout.expected
821 38b0338b 2019-11-29 stsp echo "Switching work tree to refs/heads/master" \
822 38b0338b 2019-11-29 stsp >> $testroot/stdout.expected
823 38b0338b 2019-11-29 stsp cmp -s $testroot/stdout.expected $testroot/stdout
824 38b0338b 2019-11-29 stsp ret="$?"
825 38b0338b 2019-11-29 stsp if [ "$ret" != "0" ]; then
826 38b0338b 2019-11-29 stsp diff -u $testroot/stdout.expected $testroot/stdout
827 38b0338b 2019-11-29 stsp test_done "$testroot" "$ret"
828 38b0338b 2019-11-29 stsp return 1
829 38b0338b 2019-11-29 stsp fi
830 38b0338b 2019-11-29 stsp
831 38b0338b 2019-11-29 stsp # Ensure that rebase operation was completed correctly
832 38b0338b 2019-11-29 stsp (cd $testroot/wt && got rebase -a \
833 38b0338b 2019-11-29 stsp > $testroot/stdout 2> $testroot/stderr)
834 38b0338b 2019-11-29 stsp echo -n "" > $testroot/stdout.expected
835 38b0338b 2019-11-29 stsp cmp -s $testroot/stdout.expected $testroot/stdout
836 38b0338b 2019-11-29 stsp ret="$?"
837 38b0338b 2019-11-29 stsp if [ "$ret" != "0" ]; then
838 38b0338b 2019-11-29 stsp diff -u $testroot/stdout.expected $testroot/stdout
839 38b0338b 2019-11-29 stsp test_done "$testroot" "$ret"
840 38b0338b 2019-11-29 stsp return 1
841 38b0338b 2019-11-29 stsp fi
842 38b0338b 2019-11-29 stsp echo "got: rebase operation not in progress" > $testroot/stderr.expected
843 38b0338b 2019-11-29 stsp cmp -s $testroot/stderr.expected $testroot/stderr
844 38b0338b 2019-11-29 stsp ret="$?"
845 38b0338b 2019-11-29 stsp if [ "$ret" != "0" ]; then
846 38b0338b 2019-11-29 stsp diff -u $testroot/stderr.expected $testroot/stderr
847 38b0338b 2019-11-29 stsp test_done "$testroot" "$ret"
848 38b0338b 2019-11-29 stsp return 1
849 38b0338b 2019-11-29 stsp fi
850 38b0338b 2019-11-29 stsp
851 38b0338b 2019-11-29 stsp (cd $testroot/wt && got branch > $testroot/stdout)
852 38b0338b 2019-11-29 stsp echo "master" > $testroot/stdout.expected
853 38b0338b 2019-11-29 stsp cmp -s $testroot/stdout.expected $testroot/stdout
854 38b0338b 2019-11-29 stsp ret="$?"
855 38b0338b 2019-11-29 stsp if [ "$ret" != "0" ]; then
856 38b0338b 2019-11-29 stsp diff -u $testroot/stdout.expected $testroot/stdout
857 38b0338b 2019-11-29 stsp test_done "$testroot" "$ret"
858 38b0338b 2019-11-29 stsp return 1
859 38b0338b 2019-11-29 stsp fi
860 38b0338b 2019-11-29 stsp
861 38b0338b 2019-11-29 stsp (cd $testroot/wt && got log -l3 | grep ^commit > $testroot/stdout)
862 38b0338b 2019-11-29 stsp echo "commit $commit2 (master, origin/master)" > $testroot/stdout.expected
863 38b0338b 2019-11-29 stsp echo "commit $commit1" >> $testroot/stdout.expected
864 38b0338b 2019-11-29 stsp echo "commit $commit0" >> $testroot/stdout.expected
865 38b0338b 2019-11-29 stsp cmp -s $testroot/stdout.expected $testroot/stdout
866 38b0338b 2019-11-29 stsp ret="$?"
867 38b0338b 2019-11-29 stsp if [ "$ret" != "0" ]; then
868 38b0338b 2019-11-29 stsp diff -u $testroot/stdout.expected $testroot/stdout
869 38b0338b 2019-11-29 stsp fi
870 38b0338b 2019-11-29 stsp test_done "$testroot" "$ret"
871 38b0338b 2019-11-29 stsp }
872 e51d7b55 2020-01-04 stsp
873 e51d7b55 2020-01-04 stsp function test_rebase_out_of_date {
874 e51d7b55 2020-01-04 stsp local testroot=`test_init rebase_out_of_date`
875 e51d7b55 2020-01-04 stsp local initial_commit=`git_show_head $testroot/repo`
876 e51d7b55 2020-01-04 stsp
877 e51d7b55 2020-01-04 stsp (cd $testroot/repo && git checkout -q -b newbranch)
878 e51d7b55 2020-01-04 stsp echo "modified delta on branch" > $testroot/repo/gamma/delta
879 e51d7b55 2020-01-04 stsp git_commit $testroot/repo -m "committing to delta on newbranch"
880 38b0338b 2019-11-29 stsp
881 e51d7b55 2020-01-04 stsp echo "modified alpha on branch" > $testroot/repo/alpha
882 e51d7b55 2020-01-04 stsp (cd $testroot/repo && git rm -q beta)
883 e51d7b55 2020-01-04 stsp echo "new file on branch" > $testroot/repo/epsilon/new
884 e51d7b55 2020-01-04 stsp (cd $testroot/repo && git add epsilon/new)
885 e51d7b55 2020-01-04 stsp git_commit $testroot/repo -m "committing more changes on newbranch"
886 e51d7b55 2020-01-04 stsp
887 e51d7b55 2020-01-04 stsp local orig_commit1=`git_show_parent_commit $testroot/repo`
888 e51d7b55 2020-01-04 stsp local orig_commit2=`git_show_head $testroot/repo`
889 e51d7b55 2020-01-04 stsp
890 e51d7b55 2020-01-04 stsp (cd $testroot/repo && git checkout -q master)
891 e51d7b55 2020-01-04 stsp echo "modified zeta on master" > $testroot/repo/epsilon/zeta
892 e51d7b55 2020-01-04 stsp git_commit $testroot/repo -m "committing to zeta on master"
893 e51d7b55 2020-01-04 stsp local master_commit1=`git_show_head $testroot/repo`
894 e51d7b55 2020-01-04 stsp
895 e51d7b55 2020-01-04 stsp (cd $testroot/repo && git checkout -q master)
896 e51d7b55 2020-01-04 stsp echo "modified beta on master" > $testroot/repo/beta
897 e51d7b55 2020-01-04 stsp git_commit $testroot/repo -m "committing to beta on master"
898 e51d7b55 2020-01-04 stsp local master_commit2=`git_show_head $testroot/repo`
899 e51d7b55 2020-01-04 stsp
900 e51d7b55 2020-01-04 stsp got checkout -c $master_commit1 $testroot/repo $testroot/wt \
901 e51d7b55 2020-01-04 stsp > /dev/null
902 e51d7b55 2020-01-04 stsp ret="$?"
903 e51d7b55 2020-01-04 stsp if [ "$ret" != "0" ]; then
904 e51d7b55 2020-01-04 stsp test_done "$testroot" "$ret"
905 e51d7b55 2020-01-04 stsp return 1
906 e51d7b55 2020-01-04 stsp fi
907 e51d7b55 2020-01-04 stsp
908 e51d7b55 2020-01-04 stsp (cd $testroot/wt && got rebase newbranch > $testroot/stdout \
909 e51d7b55 2020-01-04 stsp 2> $testroot/stderr)
910 e51d7b55 2020-01-04 stsp
911 e51d7b55 2020-01-04 stsp echo -n > $testroot/stdout.expected
912 e51d7b55 2020-01-04 stsp cmp -s $testroot/stdout.expected $testroot/stdout
913 e51d7b55 2020-01-04 stsp ret="$?"
914 e51d7b55 2020-01-04 stsp if [ "$ret" != "0" ]; then
915 e51d7b55 2020-01-04 stsp diff -u $testroot/stdout.expected $testroot/stdout
916 e51d7b55 2020-01-04 stsp test_done "$testroot" "$ret"
917 e51d7b55 2020-01-04 stsp return 1
918 e51d7b55 2020-01-04 stsp fi
919 e51d7b55 2020-01-04 stsp
920 e51d7b55 2020-01-04 stsp echo -n "got: work tree must be updated before it can be " \
921 e51d7b55 2020-01-04 stsp > $testroot/stderr.expected
922 e51d7b55 2020-01-04 stsp echo "used to rebase a branch" >> $testroot/stderr.expected
923 e51d7b55 2020-01-04 stsp cmp -s $testroot/stderr.expected $testroot/stderr
924 e51d7b55 2020-01-04 stsp ret="$?"
925 e51d7b55 2020-01-04 stsp if [ "$ret" != "0" ]; then
926 e51d7b55 2020-01-04 stsp diff -u $testroot/stderr.expected $testroot/stderr
927 e51d7b55 2020-01-04 stsp test_done "$testroot" "$ret"
928 e51d7b55 2020-01-04 stsp return 1
929 e51d7b55 2020-01-04 stsp fi
930 e51d7b55 2020-01-04 stsp
931 e51d7b55 2020-01-04 stsp (cd $testroot/wt && got log -l3 | grep ^commit > $testroot/stdout)
932 e51d7b55 2020-01-04 stsp echo "commit $master_commit2 (master)" > $testroot/stdout.expected
933 e51d7b55 2020-01-04 stsp echo "commit $master_commit1" >> $testroot/stdout.expected
934 e51d7b55 2020-01-04 stsp echo "commit $initial_commit" >> $testroot/stdout.expected
935 e51d7b55 2020-01-04 stsp cmp -s $testroot/stdout.expected $testroot/stdout
936 e51d7b55 2020-01-04 stsp ret="$?"
937 e51d7b55 2020-01-04 stsp if [ "$ret" != "0" ]; then
938 e51d7b55 2020-01-04 stsp diff -u $testroot/stdout.expected $testroot/stdout
939 e51d7b55 2020-01-04 stsp fi
940 e51d7b55 2020-01-04 stsp test_done "$testroot" "$ret"
941 e51d7b55 2020-01-04 stsp }
942 e51d7b55 2020-01-04 stsp
943 dcf44d04 2019-07-11 stsp run_test test_rebase_basic
944 dcf44d04 2019-07-11 stsp run_test test_rebase_ancestry_check
945 dcf44d04 2019-07-11 stsp run_test test_rebase_continue
946 dcf44d04 2019-07-11 stsp run_test test_rebase_abort
947 ff0d2220 2019-07-11 stsp run_test test_rebase_no_op_change
948 7d5807f4 2019-07-11 stsp run_test test_rebase_in_progress
949 64c6d990 2019-07-11 stsp run_test test_rebase_path_prefix
950 787c8eb6 2019-07-11 stsp run_test test_rebase_preserves_logmsg
951 fc66b545 2019-08-12 stsp run_test test_rebase_no_commits_to_rebase
952 38b0338b 2019-11-29 stsp run_test test_rebase_forward
953 e51d7b55 2020-01-04 stsp run_test test_rebase_out_of_date