push: support pushing HEAD to real branch name
[alt-git.git] / t / t3403-rebase-skip.sh
blob2ee5a00ea794e31946ee3228bc66ecc8e7d3b38f
1 #!/bin/sh
3 # Copyright (c) 2006 Eric Wong
6 test_description='git rebase --merge --skip tests'
8 . ./test-lib.sh
10 # we assume the default git-am -3 --skip strategy is tested independently
11 # and always works :)
13 test_expect_success setup '
14 echo hello > hello &&
15 git add hello &&
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 &&
25 echo moo > hello &&
26 git commit -a -m "we should skip this" &&
27 echo moo > cow &&
28 git add cow &&
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_failure 'rebase with git am -3 (default)' '
35 git rebase master
38 test_expect_success 'rebase --skip with am -3' '
39 git reset --hard HEAD &&
40 git rebase --skip
43 test_expect_success 'rebase moves back to skip-reference' '
44 test refs/heads/skip-reference = $(git symbolic-ref HEAD) &&
45 git branch post-rebase &&
46 git reset --hard pre-rebase &&
47 ! git rebase master &&
48 echo "hello" > hello &&
49 git add hello &&
50 git rebase --continue &&
51 test refs/heads/skip-reference = $(git symbolic-ref HEAD) &&
52 git reset --hard post-rebase
55 test_expect_success 'checkout skip-merge' 'git checkout -f skip-merge'
57 test_expect_failure 'rebase with --merge' 'git rebase --merge master'
59 test_expect_success 'rebase --skip with --merge' '
60 git reset --hard HEAD &&
61 git rebase --skip
64 test_expect_success 'merge and reference trees equal' \
65 'test -z "`git diff-tree skip-merge skip-reference`"'
67 test_expect_success 'moved back to branch correctly' '
68 test refs/heads/skip-merge = $(git symbolic-ref HEAD)
71 test_debug 'gitk --all & sleep 1'
73 test_done