3 # Copyright (c) 2006 Eric Wong
6 test_description='git rebase --merge --skip tests'
10 # we assume the default git am -3 --skip strategy is tested independently
13 test_expect_success setup '
16 git commit -m "hello" &&
17 git branch skip-reference &&
19 echo world >> hello &&
20 git commit -a -m "hello world" &&
21 echo goodbye >> hello &&
22 git commit -a -m "goodbye" &&
24 git checkout -f skip-reference &&
26 git commit -a -m "we should skip this" &&
29 git commit -m "this should not be skipped" &&
30 git branch pre-rebase skip-reference &&
31 git branch skip-merge skip-reference
34 test_expect_success 'rebase with git am -3 (default)' '
35 test_must_fail git rebase master
38 test_expect_success 'rebase --skip can not be used with other options' '
39 test_must_fail git rebase -v --skip &&
40 test_must_fail git rebase --skip -v
43 test_expect_success 'rebase --skip with am -3' '
47 test_expect_success 'rebase moves back to skip-reference' '
48 test refs/heads/skip-reference = $(git symbolic-ref HEAD) &&
49 git branch post-rebase &&
50 git reset --hard pre-rebase &&
51 test_must_fail git rebase master &&
52 echo "hello" > hello &&
54 git rebase --continue &&
55 test refs/heads/skip-reference = $(git symbolic-ref HEAD) &&
56 git reset --hard post-rebase
59 test_expect_success 'checkout skip-merge' 'git checkout -f skip-merge'
61 test_expect_success 'rebase with --merge' '
62 test_must_fail git rebase --merge master
65 test_expect_success 'rebase --skip with --merge' '
69 test_expect_success 'merge and reference trees equal' '
70 test -z "`git diff-tree skip-merge skip-reference`"
73 test_expect_success 'moved back to branch correctly' '
74 test refs/heads/skip-merge = $(git symbolic-ref HEAD)
77 test_debug 'gitk --all & sleep 1'