git log -p --merge [[--] paths...]
[git/git.git] / t / t6021-merge-criss-cross.sh
1 #!/bin/sh
2 #
3 # Copyright (c) 2005 Fredrik Kuivinen
4 #
5
6 # See http://marc.theaimsgroup.com/?l=git&m=111463358500362&w=2 for a
7 # nice decription of what this is about.
8
9
10 test_description='Test criss-cross merge'
11 . ./test-lib.sh
12
13 if test "$no_python"; then
14 echo "Skipping: no python => no recursive merge"
15 test_done
16 exit 0
17 fi
18
19 test_expect_success 'prepare repository' \
20 'echo "1
21 2
22 3
23 4
24 5
25 6
26 7
27 8
28 9" > file &&
29 git add file &&
30 git commit -m "Initial commit" file &&
31 git branch A &&
32 git branch B &&
33 git checkout A &&
34 echo "1
35 2
36 3
37 4
38 5
39 6
40 7
41 8 changed in B8, branch A
42 9" > file &&
43 git commit -m "B8" file &&
44 git checkout B &&
45 echo "1
46 2
47 3 changed in C3, branch B
48 4
49 5
50 6
51 7
52 8
53 9
54 " > file &&
55 git commit -m "C3" file &&
56 git branch C3 &&
57 git merge "pre E3 merge" B A &&
58 echo "1
59 2
60 3 changed in E3, branch B. New file size
61 4
62 5
63 6
64 7
65 8 changed in B8, branch A
66 9
67 " > file &&
68 git commit -m "E3" file &&
69 git checkout A &&
70 git merge "pre D8 merge" A C3 &&
71 echo "1
72 2
73 3 changed in C3, branch B
74 4
75 5
76 6
77 7
78 8 changed in D8, branch A. New file size 2
79 9" > file &&
80 git commit -m D8 file'
81
82 test_expect_success 'Criss-cross merge' 'git merge "final merge" A B'
83
84 cat > file-expect <<EOF
85 1
86 2
87 3 changed in E3, branch B. New file size
88 4
89 5
90 6
91 7
92 8 changed in D8, branch A. New file size 2
93 9
94 EOF
95
96 test_expect_success 'Criss-cross merge result' 'cmp file file-expect'
97
98 test_done