3 test_description='git rebase --onto A...B'
6 . "$TEST_DIRECTORY/lib-rebase.sh"
8 # Rebase only the tip commit of "topic" on merge base between "master"
9 # and "topic". Cannot do this for "side" with "master" because there
10 # is no single merge base.
15 # A---B---C---D---E master --> A---B---C---D---E
21 test_expect_success setup '
29 git checkout master &&
45 test_expect_success 'rebase --onto master...topic' '
50 git rebase --onto master...topic F &&
51 git rev-parse HEAD^1 >actual &&
52 git rev-parse C^0 >expect &&
53 test_cmp expect actual
56 test_expect_success 'rebase --onto master...' '
61 git rebase --onto master... F &&
62 git rev-parse HEAD^1 >actual &&
63 git rev-parse C^0 >expect &&
64 test_cmp expect actual
67 test_expect_success 'rebase --onto master...side' '
72 test_must_fail git rebase --onto master...side J
75 test_expect_success 'rebase -i --onto master...topic' '
80 EXPECT_COUNT=1 git rebase -i --onto master...topic F &&
81 git rev-parse HEAD^1 >actual &&
82 git rev-parse C^0 >expect &&
83 test_cmp expect actual
86 test_expect_success 'rebase -i --onto master...' '
91 EXPECT_COUNT=1 git rebase -i --onto master... F &&
92 git rev-parse HEAD^1 >actual &&
93 git rev-parse C^0 >expect &&
94 test_cmp expect actual
97 test_expect_success 'rebase -i --onto master...side' '
100 git reset --hard K &&
102 test_must_fail git rebase -i --onto master...side J