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' \
116 git pull . white && {
117 echo "BAD: should have conflicted"
120 test "$(git ls-files -u B | wc -l)" -eq 3 || {
121 echo "BAD: should have left stages"
124 test "$(git ls-files -s N | wc -l)" -eq 1 || {
125 echo "BAD: should have merged N"
132 echo "BAD: should have listed our change first"
135 test "$(git diff white N | wc -l)" -eq 0 || {
136 echo "BAD: should have taken colored branch"
141 test_expect_success
'pull unrenaming branch into renaming one' \
145 git pull . master && {
146 echo "BAD: should have conflicted"
149 test "$(git ls-files -u B | wc -l)" -eq 3 || {
150 echo "BAD: should have left stages"
153 test "$(git ls-files -s N | wc -l)" -eq 1 || {
154 echo "BAD: should have merged N"
161 echo "BAD: should have listed our change first"
164 test "$(git diff white N | wc -l)" -eq 0 || {
165 echo "BAD: should have taken colored branch"
170 test_expect_success
'pull conflicting renames' \
175 echo "BAD: should have conflicted"
178 test "$(git ls-files -u A | wc -l)" -eq 1 || {
179 echo "BAD: should have left a stage"
182 test "$(git ls-files -u B | wc -l)" -eq 1 || {
183 echo "BAD: should have left a stage"
186 test "$(git ls-files -u C | wc -l)" -eq 1 || {
187 echo "BAD: should have left a stage"
190 test "$(git ls-files -s N | wc -l)" -eq 1 || {
191 echo "BAD: should have merged N"
198 echo "BAD: should have listed our change first"
201 test "$(git diff white N | wc -l)" -eq 0 || {
202 echo "BAD: should have taken colored branch"