| # Copyright(C) 2008 Stephen Habermann & Andreas Ericsson |
| test_description='git rebase -p should preserve merges |
| Run "git rebase -p" and check that merges are properly carried along |
| GIT_AUTHOR_EMAIL=bogus_email_address |
| #A1--A2 <-- origin/master |
| test_expect_success 'setup for merge-preserving rebase' \ |
| git-commit -m "Add A1" && |
| git-commit -m "Add B1" && |
| git checkout -f master && |
| git-commit -a -m "Modify A2" && |
| git checkout -b topic origin/topic && |
| git merge origin/master && |
| git checkout -b topic origin/topic && |
| git merge origin/master && |
| git commit -a -m "Modify B2" |
| test_expect_success 'rebase -p fakes interactive rebase' ' |
| git rebase -p origin/topic && |
| test 1 = $(git rev-list --all --pretty=oneline | grep "Modify A" | wc -l) && |
| test 1 = $(git rev-list --all --pretty=oneline | grep "Merge commit" | wc -l) |