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 description of what this is about.
8
9
10test_description='Test criss-cross merge'
11. ./test-lib.sh
12
13if test "$no_python"; then
14 echo "Skipping: no python => no recursive merge"
15 test_done
16 exit 0
17fi
18
19test_expect_success 'prepare repository' \
20'echo "1
212
223
234
245
256
267
278
289" > file &&
29git add file &&
30git commit -m "Initial commit" file &&
31git branch A &&
32git branch B &&
33git checkout A &&
34echo "1
352
363
374
385
396
407
418 changed in B8, branch A
429" > file &&
43git commit -m "B8" file &&
44git checkout B &&
45echo "1
462
473 changed in C3, branch B
484
495
506
517
528
539
54" > file &&
55git commit -m "C3" file &&
56git branch C3 &&
57git merge "pre E3 merge" B A &&
58echo "1
592
603 changed in E3, branch B. New file size
614
625
636
647
658 changed in B8, branch A
669
67" > file &&
68git commit -m "E3" file &&
69git checkout A &&
70git merge "pre D8 merge" A C3 &&
71echo "1
722
733 changed in C3, branch B
744
755
766
777
788 changed in D8, branch A. New file size 2
799" > file &&
80git commit -m D8 file'
81
82test_expect_success 'Criss-cross merge' 'git merge "final merge" A B'
83
84cat > file-expect <<EOF
851
862
873 changed in E3, branch B. New file size
884
895
906
917
928 changed in D8, branch A. New file size 2
939
94EOF
95
96test_expect_success 'Criss-cross merge result' 'cmp file file-expect'
97
98test_done