3 # Copyright(C) 2008 Stephen Habermann & Andreas Ericsson
5 test_description
='git rebase -p should preserve merges
7 Run "git rebase -p" and check that merges are properly carried along
11 GIT_AUTHOR_EMAIL
=bogus_email_address
12 export GIT_AUTHOR_EMAIL
16 #A1--A2 <-- origin/master
24 test_expect_success
'setup for merge-preserving rebase' \
27 git-commit -m "Add A1" &&
28 git checkout -b topic &&
31 git-commit -m "Add B1" &&
32 git checkout -f master &&
34 git-commit -a -m "Modify A2" &&
36 git clone ./. clone1 &&
38 git checkout -b topic origin/topic &&
39 git merge origin/master &&
44 git checkout -b topic origin/topic &&
45 git merge origin/master &&
50 git commit -a -m "Modify B2"
53 test_expect_success
'rebase -p fakes interactive rebase' '
56 git rebase -p origin/topic &&
57 test 1 = $(git rev-list --all --pretty=oneline | grep "Modify A" | wc -l) &&
58 test 1 = $(git rev-list --all --pretty=oneline | grep "Merge commit" | wc -l)