completion: perform DWIM logic directly in __git_complete_refs
[alt-git.git] / t / t6034-merge-rename-nocruft.sh
bloba25e7304604edd8866ad7f9b94a597174b8a5ae3
1 #!/bin/sh
3 test_description='Merge-recursive merging renames'
4 . ./test-lib.sh
6 test_expect_success 'setup' '
7 cat >A <<-\EOF &&
8 a aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
9 b bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
10 c cccccccccccccccccccccccccccccccccccccccccccccccc
11 d dddddddddddddddddddddddddddddddddddddddddddddddd
12 e eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
13 f ffffffffffffffffffffffffffffffffffffffffffffffff
14 g gggggggggggggggggggggggggggggggggggggggggggggggg
15 h hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
16 i iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
17 j jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
18 k kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
19 l llllllllllllllllllllllllllllllllllllllllllllllll
20 m mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm
21 n nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
22 o oooooooooooooooooooooooooooooooooooooooooooooooo
23 EOF
25 cat >M <<-\EOF &&
26 A AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
27 B BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
28 C CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
29 D DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
30 E EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
31 F FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
32 G GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG
33 H HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
34 I IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
35 J JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJ
36 K KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK
37 L LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL
38 M MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
39 N NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
40 O OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
41 EOF
43 git add A M &&
44 git commit -m "initial has A and M" &&
45 git branch white &&
46 git branch red &&
47 git branch blue &&
49 git checkout white &&
50 sed -e "/^g /s/.*/g : white changes a line/" <A >B &&
51 sed -e "/^G /s/.*/G : colored branch changes a line/" <M >N &&
52 rm -f A M &&
53 git update-index --add --remove A B M N &&
54 git commit -m "white renames A->B, M->N" &&
56 git checkout red &&
57 echo created by red >R &&
58 git update-index --add R &&
59 git commit -m "red creates R" &&
61 git checkout blue &&
62 sed -e "/^o /s/.*/g : blue changes a line/" <A >B &&
63 rm -f A &&
64 mv B A &&
65 git update-index A &&
66 git commit -m "blue modify A" &&
68 git checkout master
71 # This test broke in 65ac6e9c3f47807cb603af07a6a9e1a43bc119ae
72 test_expect_success 'merge white into red (A->B,M->N)' '
73 git checkout -b red-white red &&
74 git merge white &&
75 git write-tree &&
76 test_path_is_file B &&
77 test_path_is_file N &&
78 test_path_is_file R &&
79 test_path_is_missing A &&
80 test_path_is_missing M
83 # This test broke in 8371234ecaaf6e14fe3f2082a855eff1bbd79ae9
84 test_expect_success 'merge blue into white (A->B, mod A, A untracked)' '
85 git checkout -b white-blue white &&
86 echo dirty >A &&
87 git merge blue &&
88 git write-tree &&
89 test_path_is_file A &&
90 echo dirty >expect &&
91 test_cmp expect A &&
92 test_path_is_file B &&
93 test_path_is_file N &&
94 test_path_is_missing M
97 test_done