3 test_description='Merge-recursive merging renames'
6 if test "$no_python"; then
7 echo "Skipping: no python => no recursive merge"
12 test_expect_success setup \
15 a aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
16 b bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
17 c cccccccccccccccccccccccccccccccccccccccccccccccc
18 d dddddddddddddddddddddddddddddddddddddddddddddddd
19 e eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
20 f ffffffffffffffffffffffffffffffffffffffffffffffff
21 g gggggggggggggggggggggggggggggggggggggggggggggggg
22 h hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
23 i iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
24 j jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
25 k kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
26 l llllllllllllllllllllllllllllllllllllllllllllllll
27 m mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm
28 n nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
29 o oooooooooooooooooooooooooooooooooooooooooooooooo
33 A AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
34 B BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
35 C CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
36 D DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
37 E EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
38 F FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
39 G GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG
40 H HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
41 I IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
42 J JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJ
43 K KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK
44 L LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL
45 M MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
46 N NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
47 O OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
51 git commit -m initial &&
56 sed -e "/^g /s/.*/g : master changes a line/" <A >A+ &&
58 git commit -a -m "master updates A" &&
61 sed -e "/^g /s/.*/g : white changes a line/" <A >B &&
62 sed -e "/^G /s/.*/G : colored branch changes a line/" <M >N &&
64 git update-index --add --remove A B M N &&
65 git commit -m "white renames A->B, M->N" &&
68 sed -e "/^g /s/.*/g : red changes a line/" <A >B &&
69 sed -e "/^G /s/.*/G : colored branch changes a line/" <M >N &&
71 git update-index --add --remove A B M N &&
72 git commit -m "red renames A->B, M->N" &&
75 sed -e "/^g /s/.*/g : blue changes a line/" <A >C &&
76 sed -e "/^G /s/.*/G : colored branch changes a line/" <M >N &&
78 git update-index --add --remove A C M N &&
79 git commit -m "blue renames A->C, M->N" &&
83 test_expect_success 'pull renaming branch into unrenaming one' \
87 echo "BAD: should have conflicted"
91 test "$(git ls-files -u B | wc -l)" -eq 3 || {
92 echo "BAD: should have left stages for B"
95 test "$(git ls-files -s N | wc -l)" -eq 1 || {
96 echo "BAD: should have merged N"
102 }" B | grep master || {
103 echo "BAD: should have listed our change first"
106 test "$(git diff white N | wc -l)" -eq 0 || {
107 echo "BAD: should have taken colored branch"
112 test_expect_success 'pull renaming branch into another renaming one' \
117 git pull . white && {
118 echo "BAD: should have conflicted"
121 test "$(git ls-files -u B | wc -l)" -eq 3 || {
122 echo "BAD: should have left stages"
125 test "$(git ls-files -s N | wc -l)" -eq 1 || {
126 echo "BAD: should have merged N"
133 echo "BAD: should have listed our change first"
136 test "$(git diff white N | wc -l)" -eq 0 || {
137 echo "BAD: should have taken colored branch"
142 test_expect_success 'pull unrenaming branch into renaming one' \
146 git pull . master && {
147 echo "BAD: should have conflicted"
150 test "$(git ls-files -u B | wc -l)" -eq 3 || {
151 echo "BAD: should have left stages"
154 test "$(git ls-files -s N | wc -l)" -eq 1 || {
155 echo "BAD: should have merged N"
162 echo "BAD: should have listed our change first"
165 test "$(git diff white N | wc -l)" -eq 0 || {
166 echo "BAD: should have taken colored branch"
171 test_expect_success 'pull conflicting renames' \
176 echo "BAD: should have conflicted"
179 test "$(git ls-files -u A | wc -l)" -eq 1 || {
180 echo "BAD: should have left a stage"
183 test "$(git ls-files -u B | wc -l)" -eq 1 || {
184 echo "BAD: should have left a stage"
187 test "$(git ls-files -u C | wc -l)" -eq 1 || {
188 echo "BAD: should have left a stage"
191 test "$(git ls-files -s N | wc -l)" -eq 1 || {
192 echo "BAD: should have merged N"
199 echo "BAD: should have listed our change first"
202 test "$(git diff white N | wc -l)" -eq 0 || {
203 echo "BAD: should have taken colored branch"