Merge branch 'ar/maint-mksnpath' into HEAD
[git.git] / t / t3409-rebase-preserve-merges.sh
blob8cde40f8e80b5df9e8ebf1cd66cd196817107cd4
1 #!/bin/sh
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
9 . ./test-lib.sh
11 GIT_AUTHOR_EMAIL=bogus_email_address
12 export GIT_AUTHOR_EMAIL
14 #echo 'Setting up:
16 #A1--A2 <-- origin/master
17 # \ \
18 # B1--M <-- topic
19 # \
20 # B2 <-- origin/topic
24 test_expect_success 'setup for merge-preserving rebase' \
25 'echo First > A &&
26 git add A &&
27 git-commit -m "Add A1" &&
28 git checkout -b topic &&
29 echo Second > B &&
30 git add B &&
31 git-commit -m "Add B1" &&
32 git checkout -f master &&
33 echo Third >> A &&
34 git-commit -a -m "Modify A2" &&
36 git clone ./. clone1 &&
37 cd clone1 &&
38 git checkout -b topic origin/topic &&
39 git merge origin/master &&
40 cd ..
42 git clone ./. clone2
43 cd clone2 &&
44 git checkout -b topic origin/topic &&
45 git merge origin/master &&
46 cd .. &&
48 git checkout topic &&
49 echo Fourth >> B &&
50 git commit -a -m "Modify B2"
53 test_expect_success 'rebase -p fakes interactive rebase' '
54 cd clone2 &&
55 git fetch &&
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)
61 test_done