3 # Copyright (c) 2006 Junio C Hamano
6 test_description='git rebase --merge test'
11 jumps over the lazy dog."
12 for i in 1 2 3 4 5 6 7 8 9 10
17 test_expect_success setup '
19 git commit -m"initial" &&
21 echo "11 $T" >>original &&
22 git commit -a -m"master updates a bit." &&
24 echo "12 $T" >>original &&
25 git commit -a -m"master updates a bit more." &&
28 (echo "0 $T" ; cat original) >renamed &&
30 git update-index --force-remove original &&
31 git commit -a -m"side renames and edits." &&
33 tr "[a-z]" "[A-Z]" <original >newfile &&
35 git commit -a -m"side edits further." &&
37 tr "[a-m]" "[A-M]" <original >newfile &&
39 git commit -a -m"side edits once again." &&
41 git branch test-rebase side &&
42 git branch test-rebase-pick side &&
43 git branch test-reference-pick side &&
44 git checkout -b test-merge side
47 test_expect_success 'reference merge' '
48 git merge -s recursive "reference merge" HEAD master
51 PRE_REBASE=$(git rev-parse test-rebase)
52 test_expect_success rebase '
53 git checkout test-rebase &&
54 GIT_TRACE=1 git rebase --merge master
57 test_expect_success 'test-rebase@{1} is pre rebase' '
58 test $PRE_REBASE = $(git rev-parse test-rebase@{1})
61 test_expect_success 'merge and rebase should match' '
62 git diff-tree -r test-rebase test-merge >difference &&
72 test_expect_success 'rebase the other way' '
73 git reset --hard master &&
74 git rebase --merge side
77 test_expect_success 'merge and rebase should match' '
78 git diff-tree -r test-rebase test-merge >difference &&
88 test_expect_success 'picking rebase' '
89 git reset --hard side &&
90 git rebase --merge --onto master side^^ &&
91 mb=$(git merge-base master HEAD) &&
92 if test "$mb" = "$(git rev-parse master)"
99 f=$(git diff-tree --name-only HEAD^ HEAD) &&
100 g=$(git diff-tree --name-only HEAD^^ HEAD^) &&