3 # Copyright (c) 2019 Stefan Sperling <stsp@openbsd.org>
5 # Permission to use, copy, modify, and distribute this software for any
6 # purpose with or without fee is hereby granted, provided that the above
7 # copyright notice and this permission notice appear in all copies.
9 # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
19 function test_rebase_basic {
20 local testroot=`test_init rebase_basic`
22 (cd $testroot/repo && git checkout -q -b newbranch)
23 echo "modified delta on branch" > $testroot/repo/gamma/delta
24 git_commit $testroot/repo -m "committing to delta on newbranch"
26 echo "modified alpha on branch" > $testroot/repo/alpha
27 (cd $testroot/repo && git rm -q beta)
28 echo "new file on branch" > $testroot/repo/epsilon/new
29 (cd $testroot/repo && git add epsilon/new)
30 git_commit $testroot/repo -m "committing more changes on newbranch"
32 local orig_commit1=`git_show_parent_commit $testroot/repo`
33 local orig_commit2=`git_show_head $testroot/repo`
35 (cd $testroot/repo && git checkout -q master)
36 echo "modified zeta on master" > $testroot/repo/epsilon/zeta
37 git_commit $testroot/repo -m "committing to zeta on master"
38 local master_commit=`git_show_head $testroot/repo`
40 got checkout $testroot/repo $testroot/wt > /dev/null
42 if [ "$ret" != "0" ]; then
43 test_done "$testroot" "$ret"
47 (cd $testroot/wt && got rebase newbranch > $testroot/stdout)
49 (cd $testroot/repo && git checkout -q newbranch)
50 local new_commit1=`git_show_parent_commit $testroot/repo`
51 local new_commit2=`git_show_head $testroot/repo`
53 local short_orig_commit1=`trim_obj_id 28 $orig_commit1`
54 local short_orig_commit2=`trim_obj_id 28 $orig_commit2`
55 local short_new_commit1=`trim_obj_id 28 $new_commit1`
56 local short_new_commit2=`trim_obj_id 28 $new_commit2`
58 echo "G gamma/delta" >> $testroot/stdout.expected
59 echo -n "$short_orig_commit1 -> $short_new_commit1" \
60 >> $testroot/stdout.expected
61 echo ": committing to delta on newbranch" >> $testroot/stdout.expected
62 echo "G alpha" >> $testroot/stdout.expected
63 echo "D beta" >> $testroot/stdout.expected
64 echo "A epsilon/new" >> $testroot/stdout.expected
65 echo -n "$short_orig_commit2 -> $short_new_commit2" \
66 >> $testroot/stdout.expected
67 echo ": committing more changes on newbranch" \
68 >> $testroot/stdout.expected
69 echo "Switching work tree to refs/heads/newbranch" \
70 >> $testroot/stdout.expected
72 cmp -s $testroot/stdout.expected $testroot/stdout
74 if [ "$ret" != "0" ]; then
75 diff -u $testroot/stdout.expected $testroot/stdout
76 test_done "$testroot" "$ret"
80 echo "modified delta on branch" > $testroot/content.expected
81 cat $testroot/wt/gamma/delta > $testroot/content
82 cmp -s $testroot/content.expected $testroot/content
84 if [ "$ret" != "0" ]; then
85 diff -u $testroot/content.expected $testroot/content
86 test_done "$testroot" "$ret"
90 echo "modified alpha on branch" > $testroot/content.expected
91 cat $testroot/wt/alpha > $testroot/content
92 cmp -s $testroot/content.expected $testroot/content
94 if [ "$ret" != "0" ]; then
95 diff -u $testroot/content.expected $testroot/content
96 test_done "$testroot" "$ret"
100 if [ -e $testroot/wt/beta ]; then
101 echo "removed file beta still exists on disk" >&2
102 test_done "$testroot" "1"
106 echo "new file on branch" > $testroot/content.expected
107 cat $testroot/wt/epsilon/new > $testroot/content
108 cmp -s $testroot/content.expected $testroot/content
110 if [ "$ret" != "0" ]; then
111 diff -u $testroot/content.expected $testroot/content
112 test_done "$testroot" "$ret"
116 (cd $testroot/wt && got status > $testroot/stdout)
118 echo -n > $testroot/stdout.expected
119 cmp -s $testroot/stdout.expected $testroot/stdout
121 if [ "$ret" != "0" ]; then
122 diff -u $testroot/stdout.expected $testroot/stdout
123 test_done "$testroot" "$ret"
127 (cd $testroot/wt && got log -l3 | grep ^commit > $testroot/stdout)
128 echo "commit $new_commit2 (newbranch)" > $testroot/stdout.expected
129 echo "commit $new_commit1" >> $testroot/stdout.expected
130 echo "commit $master_commit (master)" >> $testroot/stdout.expected
131 cmp -s $testroot/stdout.expected $testroot/stdout
133 if [ "$ret" != "0" ]; then
134 diff -u $testroot/stdout.expected $testroot/stdout
136 test_done "$testroot" "$ret"
139 function test_rebase_ancestry_check {
140 local testroot=`test_init rebase_ancestry_check`
142 got checkout $testroot/repo $testroot/wt > /dev/null
144 if [ "$ret" != "0" ]; then
145 test_done "$testroot" "$ret"
149 (cd $testroot/repo && git checkout -q -b newbranch)
150 echo "modified delta on branch" > $testroot/repo/gamma/delta
151 git_commit $testroot/repo -m "committing to delta on newbranch"
153 (cd $testroot/wt && got rebase newbranch > $testroot/stdout \
156 echo -n > $testroot/stdout.expected
157 cmp -s $testroot/stdout.expected $testroot/stdout
159 if [ "$ret" != "0" ]; then
160 diff -u $testroot/stdout.expected $testroot/stdout
161 test_done "$testroot" "$ret"
165 echo -n "got: specified branch resolves to a commit " \
166 > $testroot/stderr.expected
167 echo "which is already contained in work tree's branch" \
168 >> $testroot/stderr.expected
169 cmp -s $testroot/stderr.expected $testroot/stderr
171 if [ "$ret" != "0" ]; then
172 diff -u $testroot/stderr.expected $testroot/stderr
174 test_done "$testroot" "$ret"
177 function test_rebase_continue {
178 local testroot=`test_init rebase_continue`
180 (cd $testroot/repo && git checkout -q -b newbranch)
181 echo "modified alpha on branch" > $testroot/repo/alpha
182 git_commit $testroot/repo -m "committing to alpha on newbranch"
183 local orig_commit1=`git_show_head $testroot/repo`
185 (cd $testroot/repo && git checkout -q master)
186 echo "modified alpha on master" > $testroot/repo/alpha
187 git_commit $testroot/repo -m "committing to alpha on master"
188 local master_commit=`git_show_head $testroot/repo`
190 got checkout $testroot/repo $testroot/wt > /dev/null
192 if [ "$ret" != "0" ]; then
193 test_done "$testroot" "$ret"
197 (cd $testroot/wt && got rebase newbranch > $testroot/stdout \
200 echo "C alpha" > $testroot/stdout.expected
201 cmp -s $testroot/stdout.expected $testroot/stdout
203 if [ "$ret" != "0" ]; then
204 diff -u $testroot/stdout.expected $testroot/stdout
205 test_done "$testroot" "$ret"
209 echo "got: conflicts must be resolved before rebasing can continue" \
210 > $testroot/stderr.expected
211 cmp -s $testroot/stderr.expected $testroot/stderr
213 if [ "$ret" != "0" ]; then
214 diff -u $testroot/stderr.expected $testroot/stderr
215 test_done "$testroot" "$ret"
219 echo "<<<<<<< commit $orig_commit1" > $testroot/content.expected
220 echo "modified alpha on branch" >> $testroot/content.expected
221 echo "=======" >> $testroot/content.expected
222 echo "modified alpha on master" >> $testroot/content.expected
223 echo '>>>>>>> alpha' >> $testroot/content.expected
224 cat $testroot/wt/alpha > $testroot/content
225 cmp -s $testroot/content.expected $testroot/content
227 if [ "$ret" != "0" ]; then
228 diff -u $testroot/content.expected $testroot/content
229 test_done "$testroot" "$ret"
233 (cd $testroot/wt && got status > $testroot/stdout)
235 echo "C alpha" > $testroot/stdout.expected
236 cmp -s $testroot/stdout.expected $testroot/stdout
238 if [ "$ret" != "0" ]; then
239 diff -u $testroot/stdout.expected $testroot/stdout
240 test_done "$testroot" "$ret"
244 # resolve the conflict
245 echo "modified alpha on branch and master" > $testroot/wt/alpha
247 # test interaction of 'got stage' and rebase -c
248 (cd $testroot/wt && got stage alpha > /dev/null)
249 (cd $testroot/wt && got rebase -c > $testroot/stdout \
252 if [ "$ret" == "0" ]; then
253 echo "rebase succeeded unexpectedly" >&2
254 test_done "$testroot" "1"
257 echo -n "got: work tree contains files with staged changes; " \
258 > $testroot/stderr.expected
259 echo "these changes must be committed or unstaged first" \
260 >> $testroot/stderr.expected
261 cmp -s $testroot/stderr.expected $testroot/stderr
263 if [ "$ret" != "0" ]; then
264 diff -u $testroot/stderr.expected $testroot/stderr
265 test_done "$testroot" "$ret"
269 (cd $testroot/wt && got unstage alpha > /dev/null)
270 (cd $testroot/wt && got rebase -c > $testroot/stdout)
272 (cd $testroot/repo && git checkout -q newbranch)
273 local new_commit1=`git_show_head $testroot/repo`
275 local short_orig_commit1=`trim_obj_id 28 $orig_commit1`
276 local short_new_commit1=`trim_obj_id 28 $new_commit1`
278 echo -n "$short_orig_commit1 -> $short_new_commit1" \
279 > $testroot/stdout.expected
280 echo ": committing to alpha on newbranch" >> $testroot/stdout.expected
281 echo "Switching work tree to refs/heads/newbranch" \
282 >> $testroot/stdout.expected
284 cmp -s $testroot/stdout.expected $testroot/stdout
286 if [ "$ret" != "0" ]; then
287 diff -u $testroot/stdout.expected $testroot/stdout
288 test_done "$testroot" "$ret"
293 (cd $testroot/wt && got log -l2 | grep ^commit > $testroot/stdout)
294 echo "commit $new_commit1 (newbranch)" > $testroot/stdout.expected
295 echo "commit $master_commit (master)" >> $testroot/stdout.expected
296 cmp -s $testroot/stdout.expected $testroot/stdout
298 if [ "$ret" != "0" ]; then
299 diff -u $testroot/stdout.expected $testroot/stdout
301 test_done "$testroot" "$ret"
304 function test_rebase_abort {
305 local testroot=`test_init rebase_abort`
307 local init_commit=`git_show_head $testroot/repo`
309 (cd $testroot/repo && git checkout -q -b newbranch)
310 echo "modified alpha on branch" > $testroot/repo/alpha
311 git_commit $testroot/repo -m "committing to alpha on newbranch"
312 local orig_commit1=`git_show_head $testroot/repo`
314 (cd $testroot/repo && git checkout -q master)
315 echo "modified alpha on master" > $testroot/repo/alpha
316 git_commit $testroot/repo -m "committing to alpha on master"
317 local master_commit=`git_show_head $testroot/repo`
319 got checkout $testroot/repo $testroot/wt > /dev/null
321 if [ "$ret" != "0" ]; then
322 test_done "$testroot" "$ret"
326 (cd $testroot/wt && got rebase newbranch > $testroot/stdout \
329 echo "C alpha" > $testroot/stdout.expected
330 cmp -s $testroot/stdout.expected $testroot/stdout
332 if [ "$ret" != "0" ]; then
333 diff -u $testroot/stdout.expected $testroot/stdout
334 test_done "$testroot" "$ret"
338 echo "got: conflicts must be resolved before rebasing can continue" \
339 > $testroot/stderr.expected
340 cmp -s $testroot/stderr.expected $testroot/stderr
342 if [ "$ret" != "0" ]; then
343 diff -u $testroot/stderr.expected $testroot/stderr
344 test_done "$testroot" "$ret"
348 echo "<<<<<<< commit $orig_commit1" > $testroot/content.expected
349 echo "modified alpha on branch" >> $testroot/content.expected
350 echo "=======" >> $testroot/content.expected
351 echo "modified alpha on master" >> $testroot/content.expected
352 echo '>>>>>>> alpha' >> $testroot/content.expected
353 cat $testroot/wt/alpha > $testroot/content
354 cmp -s $testroot/content.expected $testroot/content
356 if [ "$ret" != "0" ]; then
357 diff -u $testroot/content.expected $testroot/content
358 test_done "$testroot" "$ret"
362 (cd $testroot/wt && got status > $testroot/stdout)
364 echo "C alpha" > $testroot/stdout.expected
365 cmp -s $testroot/stdout.expected $testroot/stdout
367 if [ "$ret" != "0" ]; then
368 diff -u $testroot/stdout.expected $testroot/stdout
369 test_done "$testroot" "$ret"
373 (cd $testroot/wt && got rebase -a > $testroot/stdout)
375 (cd $testroot/repo && git checkout -q newbranch)
377 echo "Switching work tree to refs/heads/master" \
378 > $testroot/stdout.expected
379 echo 'R alpha' >> $testroot/stdout.expected
380 echo "Rebase of refs/heads/newbranch aborted" \
381 >> $testroot/stdout.expected
383 cmp -s $testroot/stdout.expected $testroot/stdout
385 if [ "$ret" != "0" ]; then
386 diff -u $testroot/stdout.expected $testroot/stdout
387 test_done "$testroot" "$ret"
391 echo "modified alpha on master" > $testroot/content.expected
392 cat $testroot/wt/alpha > $testroot/content
393 cmp -s $testroot/content.expected $testroot/content
395 if [ "$ret" != "0" ]; then
396 diff -u $testroot/content.expected $testroot/content
397 test_done "$testroot" "$ret"
401 (cd $testroot/wt && got log -l3 -c newbranch \
402 | grep ^commit > $testroot/stdout)
403 echo "commit $orig_commit1 (newbranch)" > $testroot/stdout.expected
404 echo "commit $init_commit" >> $testroot/stdout.expected
405 cmp -s $testroot/stdout.expected $testroot/stdout
407 if [ "$ret" != "0" ]; then
408 diff -u $testroot/stdout.expected $testroot/stdout
410 test_done "$testroot" "$ret"
413 function test_rebase_no_op_change {
414 local testroot=`test_init rebase_no_op_change`
415 local init_commit=`git_show_head $testroot/repo`
417 (cd $testroot/repo && git checkout -q -b newbranch)
418 echo "modified alpha on branch" > $testroot/repo/alpha
419 git_commit $testroot/repo -m "committing to alpha on newbranch"
420 local orig_commit1=`git_show_head $testroot/repo`
422 (cd $testroot/repo && git checkout -q master)
423 echo "modified alpha on master" > $testroot/repo/alpha
424 git_commit $testroot/repo -m "committing to alpha on master"
425 local master_commit=`git_show_head $testroot/repo`
427 got checkout $testroot/repo $testroot/wt > /dev/null
429 if [ "$ret" != "0" ]; then
430 test_done "$testroot" "$ret"
434 (cd $testroot/wt && got rebase newbranch > $testroot/stdout \
437 echo "C alpha" > $testroot/stdout.expected
438 cmp -s $testroot/stdout.expected $testroot/stdout
440 if [ "$ret" != "0" ]; then
441 diff -u $testroot/stdout.expected $testroot/stdout
442 test_done "$testroot" "$ret"
446 echo "got: conflicts must be resolved before rebasing can continue" \
447 > $testroot/stderr.expected
448 cmp -s $testroot/stderr.expected $testroot/stderr
450 if [ "$ret" != "0" ]; then
451 diff -u $testroot/stderr.expected $testroot/stderr
452 test_done "$testroot" "$ret"
456 echo "<<<<<<< commit $orig_commit1" > $testroot/content.expected
457 echo "modified alpha on branch" >> $testroot/content.expected
458 echo "=======" >> $testroot/content.expected
459 echo "modified alpha on master" >> $testroot/content.expected
460 echo '>>>>>>> alpha' >> $testroot/content.expected
461 cat $testroot/wt/alpha > $testroot/content
462 cmp -s $testroot/content.expected $testroot/content
464 if [ "$ret" != "0" ]; then
465 diff -u $testroot/content.expected $testroot/content
466 test_done "$testroot" "$ret"
470 (cd $testroot/wt && got status > $testroot/stdout)
472 echo "C alpha" > $testroot/stdout.expected
473 cmp -s $testroot/stdout.expected $testroot/stdout
475 if [ "$ret" != "0" ]; then
476 diff -u $testroot/stdout.expected $testroot/stdout
477 test_done "$testroot" "$ret"
481 # resolve the conflict
482 echo "modified alpha on master" > $testroot/wt/alpha
484 (cd $testroot/wt && got rebase -c > $testroot/stdout)
486 (cd $testroot/repo && git checkout -q newbranch)
487 local new_commit1=`git_show_head $testroot/repo`
489 local short_orig_commit1=`trim_obj_id 28 $orig_commit1`
491 echo -n "$short_orig_commit1 -> no-op change" \
492 > $testroot/stdout.expected
493 echo ": committing to alpha on newbranch" >> $testroot/stdout.expected
494 echo "Switching work tree to refs/heads/newbranch" \
495 >> $testroot/stdout.expected
497 cmp -s $testroot/stdout.expected $testroot/stdout
499 if [ "$ret" != "0" ]; then
500 diff -u $testroot/stdout.expected $testroot/stdout
501 test_done "$testroot" "$ret"
506 (cd $testroot/wt && got log -l2 | grep ^commit > $testroot/stdout)
507 echo "commit $master_commit (master, newbranch)" \
508 > $testroot/stdout.expected
509 echo "commit $init_commit" >> $testroot/stdout.expected
510 cmp -s $testroot/stdout.expected $testroot/stdout
512 if [ "$ret" != "0" ]; then
513 diff -u $testroot/stdout.expected $testroot/stdout
515 test_done "$testroot" "$ret"
518 function test_rebase_in_progress {
519 local testroot=`test_init rebase_in_progress`
520 local init_commit=`git_show_head $testroot/repo`
522 (cd $testroot/repo && git checkout -q -b newbranch)
523 echo "modified alpha on branch" > $testroot/repo/alpha
524 git_commit $testroot/repo -m "committing to alpha on newbranch"
525 local orig_commit1=`git_show_head $testroot/repo`
527 (cd $testroot/repo && git checkout -q master)
528 echo "modified alpha on master" > $testroot/repo/alpha
529 git_commit $testroot/repo -m "committing to alpha on master"
530 local master_commit=`git_show_head $testroot/repo`
532 got checkout $testroot/repo $testroot/wt > /dev/null
534 if [ "$ret" != "0" ]; then
535 test_done "$testroot" "$ret"
539 (cd $testroot/wt && got rebase newbranch > $testroot/stdout \
542 echo "C alpha" > $testroot/stdout.expected
543 cmp -s $testroot/stdout.expected $testroot/stdout
545 if [ "$ret" != "0" ]; then
546 diff -u $testroot/stdout.expected $testroot/stdout
547 test_done "$testroot" "$ret"
551 echo "got: conflicts must be resolved before rebasing can continue" \
552 > $testroot/stderr.expected
553 cmp -s $testroot/stderr.expected $testroot/stderr
555 if [ "$ret" != "0" ]; then
556 diff -u $testroot/stderr.expected $testroot/stderr
557 test_done "$testroot" "$ret"
561 echo "<<<<<<< commit $orig_commit1" > $testroot/content.expected
562 echo "modified alpha on branch" >> $testroot/content.expected
563 echo "=======" >> $testroot/content.expected
564 echo "modified alpha on master" >> $testroot/content.expected
565 echo '>>>>>>> alpha' >> $testroot/content.expected
566 cat $testroot/wt/alpha > $testroot/content
567 cmp -s $testroot/content.expected $testroot/content
569 if [ "$ret" != "0" ]; then
570 diff -u $testroot/content.expected $testroot/content
571 test_done "$testroot" "$ret"
575 (cd $testroot/wt && got status > $testroot/stdout)
577 echo "C alpha" > $testroot/stdout.expected
578 cmp -s $testroot/stdout.expected $testroot/stdout
580 if [ "$ret" != "0" ]; then
581 diff -u $testroot/stdout.expected $testroot/stdout
582 test_done "$testroot" "$ret"
586 for cmd in update commit; do
587 (cd $testroot/wt && got $cmd > $testroot/stdout \
590 echo -n > $testroot/stdout.expected
591 cmp -s $testroot/stdout.expected $testroot/stdout
593 if [ "$ret" != "0" ]; then
594 diff -u $testroot/stdout.expected $testroot/stdout
595 test_done "$testroot" "$ret"
599 echo -n "got: a rebase operation is in progress in this " \
600 > $testroot/stderr.expected
601 echo "work tree and must be continued or aborted first" \
602 >> $testroot/stderr.expected
603 cmp -s $testroot/stderr.expected $testroot/stderr
605 if [ "$ret" != "0" ]; then
606 diff -u $testroot/stderr.expected $testroot/stderr
607 test_done "$testroot" "$ret"
612 test_done "$testroot" "$ret"
615 function test_rebase_path_prefix {
616 local testroot=`test_init rebase_path_prefix`
618 (cd $testroot/repo && git checkout -q -b newbranch)
619 echo "modified delta on branch" > $testroot/repo/gamma/delta
620 git_commit $testroot/repo -m "committing to delta on newbranch"
622 local orig_commit1=`git_show_parent_commit $testroot/repo`
623 local orig_commit2=`git_show_head $testroot/repo`
625 (cd $testroot/repo && git checkout -q master)
626 echo "modified zeta on master" > $testroot/repo/epsilon/zeta
627 git_commit $testroot/repo -m "committing to zeta on master"
628 local master_commit=`git_show_head $testroot/repo`
630 got checkout -p epsilon $testroot/repo $testroot/wt > /dev/null
632 if [ "$ret" != "0" ]; then
633 test_done "$testroot" "$ret"
637 (cd $testroot/wt && got rebase newbranch \
638 > $testroot/stdout 2> $testroot/stderr)
640 echo -n > $testroot/stdout.expected
641 cmp -s $testroot/stdout.expected $testroot/stdout
643 if [ "$ret" != "0" ]; then
644 diff -u $testroot/stdout.expected $testroot/stdout
645 test_done "$testroot" "$ret"
649 echo -n "got: cannot rebase branch which contains changes outside " \
650 > $testroot/stderr.expected
651 echo "of this work tree's path prefix" >> $testroot/stderr.expected
652 cmp -s $testroot/stderr.expected $testroot/stderr
654 if [ "$ret" != "0" ]; then
655 diff -u $testroot/stderr.expected $testroot/stderr
657 test_done "$testroot" "$ret"
660 function test_rebase_preserves_logmsg {
661 local testroot=`test_init rebase_preserves_logmsg`
663 (cd $testroot/repo && git checkout -q -b newbranch)
664 echo "modified delta on branch" > $testroot/repo/gamma/delta
665 git_commit $testroot/repo -m "modified delta on newbranch"
667 echo "modified alpha on branch" > $testroot/repo/alpha
668 git_commit $testroot/repo -m "modified alpha on newbranch"
670 (cd $testroot/repo && got log -c newbranch -l2 | grep -v ^date: \
671 > $testroot/log.expected)
673 local orig_commit1=`git_show_parent_commit $testroot/repo`
674 local orig_commit2=`git_show_head $testroot/repo`
676 (cd $testroot/repo && git checkout -q master)
677 echo "modified zeta on master" > $testroot/repo/epsilon/zeta
678 git_commit $testroot/repo -m "committing to zeta on master"
679 local master_commit=`git_show_head $testroot/repo`
681 got checkout $testroot/repo $testroot/wt > /dev/null
683 if [ "$ret" != "0" ]; then
684 test_done "$testroot" "$ret"
688 (cd $testroot/wt && got rebase newbranch > /dev/null \
691 (cd $testroot/repo && git checkout -q newbranch)
692 local new_commit1=`git_show_parent_commit $testroot/repo`
693 local new_commit2=`git_show_head $testroot/repo`
695 echo -n > $testroot/stderr.expected
696 cmp -s $testroot/stderr.expected $testroot/stderr
698 if [ "$ret" != "0" ]; then
699 diff -u $testroot/stderr.expected $testroot/stderr
700 test_done "$testroot" "$ret"
704 (cd $testroot/wt && got log -c newbranch -l2 | grep -v ^date: \
706 sed -i -e "s/$orig_commit1/$new_commit1/" $testroot/log.expected
707 sed -i -e "s/$orig_commit2/$new_commit2/" $testroot/log.expected
708 cmp -s $testroot/log.expected $testroot/log
710 if [ "$ret" != "0" ]; then
711 diff -u $testroot/log.expected $testroot/log
714 test_done "$testroot" "$ret"
717 run_test test_rebase_basic
718 run_test test_rebase_ancestry_check
719 run_test test_rebase_continue
720 run_test test_rebase_abort
721 run_test test_rebase_no_op_change
722 run_test test_rebase_in_progress
723 run_test test_rebase_path_prefix
724 run_test test_rebase_preserves_logmsg