]>
Commit | Line | Data |
---|---|---|
e77f489e YD |
1 | #!/bin/sh |
2 | # | |
3 | # Copyright (c) 2006 Yann Dirson, based on t3400 by Amos Waterland | |
4 | # | |
5 | ||
6 | test_description='git rebase should detect patches integrated upstream | |
7 | ||
8 | This test cherry-picks one local change of two into master branch, and | |
9 | checks that git rebase succeeds with only the second patch in the | |
10 | local branch. | |
11 | ' | |
12 | . ./test-lib.sh | |
13 | ||
14 | test_expect_success \ | |
15 | 'prepare repository with topic branch' \ | |
16 | 'echo First > A && | |
5be60078 | 17 | git update-index --add A && |
0cb0e143 | 18 | git commit -m "Add A." && |
e77f489e | 19 | |
0cb0e143 | 20 | git checkout -b my-topic-branch && |
e77f489e YD |
21 | |
22 | echo Second > B && | |
5be60078 | 23 | git update-index --add B && |
0cb0e143 | 24 | git commit -m "Add B." && |
e77f489e YD |
25 | |
26 | echo AnotherSecond > C && | |
5be60078 | 27 | git update-index --add C && |
0cb0e143 | 28 | git commit -m "Add C." && |
e77f489e | 29 | |
0cb0e143 | 30 | git checkout -f master && |
e77f489e YD |
31 | |
32 | echo Third >> A && | |
5be60078 | 33 | git update-index A && |
0cb0e143 | 34 | git commit -m "Modify A." |
e77f489e YD |
35 | ' |
36 | ||
37 | test_expect_success \ | |
38 | 'pick top patch from topic branch into master' \ | |
5be60078 | 39 | 'git cherry-pick my-topic-branch^0 && |
0cb0e143 | 40 | git checkout -f my-topic-branch && |
5be60078 JH |
41 | git branch master-merge master && |
42 | git branch my-topic-branch-merge my-topic-branch | |
e77f489e YD |
43 | ' |
44 | ||
45 | test_debug \ | |
5be60078 JH |
46 | 'git cherry master && |
47 | git format-patch -k --stdout --full-index master >/dev/null && | |
e77f489e YD |
48 | gitk --all & sleep 1 |
49 | ' | |
50 | ||
51 | test_expect_success \ | |
0cb0e143 NS |
52 | 'rebase topic branch against new master and check git am did not get halted' \ |
53 | 'git rebase master && test ! -d .git/rebase-apply' | |
e77f489e | 54 | |
36889a50 | 55 | test_expect_success \ |
9a99c087 | 56 | 'rebase --merge topic branch that was partially merged upstream' \ |
0cb0e143 NS |
57 | 'git checkout -f my-topic-branch-merge && |
58 | git rebase --merge master-merge && | |
28ed6e7b | 59 | test ! -d .git/rebase-merge' |
9a99c087 | 60 | |
e77f489e | 61 | test_done |