]> git.ipfire.org Git - thirdparty/git.git/blame - t/t3403-rebase-skip.sh
path.c: don't call the match function without value in trie_find()
[thirdparty/git.git] / t / t3403-rebase-skip.sh
CommitLineData
d5e673b6
EW
1#!/bin/sh
2#
3# Copyright (c) 2006 Eric Wong
4#
5
6test_description='git rebase --merge --skip tests'
7
8. ./test-lib.sh
9
0cb0e143 10# we assume the default git am -3 --skip strategy is tested independently
d5e673b6
EW
11# and always works :)
12
d5e673b6
EW
13test_expect_success setup '
14 echo hello > hello &&
15 git add hello &&
16 git commit -m "hello" &&
17 git branch skip-reference &&
18
19 echo world >> hello &&
20 git commit -a -m "hello world" &&
21 echo goodbye >> hello &&
22 git commit -a -m "goodbye" &&
23
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
32 '
33
41ac414e 34test_expect_success 'rebase with git am -3 (default)' '
d492b31c 35 test_must_fail git rebase master
4be60962 36'
d5e673b6 37
95135b06
MZ
38test_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
41'
42
d5e673b6 43test_expect_success 'rebase --skip with am -3' '
d5e673b6
EW
44 git rebase --skip
45 '
3f735b66
JS
46
47test_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 &&
d492b31c 51 test_must_fail git rebase master &&
3f735b66
JS
52 echo "hello" > hello &&
53 git add hello &&
54 git rebase --continue &&
55 test refs/heads/skip-reference = $(git symbolic-ref HEAD) &&
56 git reset --hard post-rebase
57'
58
d5e673b6
EW
59test_expect_success 'checkout skip-merge' 'git checkout -f skip-merge'
60
d492b31c
SB
61test_expect_success 'rebase with --merge' '
62 test_must_fail git rebase --merge master
63'
d5e673b6
EW
64
65test_expect_success 'rebase --skip with --merge' '
d5e673b6 66 git rebase --skip
15c7348e 67'
d5e673b6 68
15c7348e 69test_expect_success 'merge and reference trees equal' '
c82ec45e 70 test -z "$(git diff-tree skip-merge skip-reference)"
15c7348e 71'
d5e673b6 72
3f735b66
JS
73test_expect_success 'moved back to branch correctly' '
74 test refs/heads/skip-merge = $(git symbolic-ref HEAD)
75'
76
d5e673b6
EW
77test_debug 'gitk --all & sleep 1'
78
79test_done