]> git.ipfire.org Git - thirdparty/git.git/blame - t/t6021-merge-criss-cross.sh
Merge branch 'py/git-gui-has-maintainer'
[thirdparty/git.git] / t / t6021-merge-criss-cross.sh
CommitLineData
70574634
FK
1#!/bin/sh
2#
3# Copyright (c) 2005 Fredrik Kuivinen
4#
5
efe6de6e 6# See http://marc.info/?l=git&m=111463358500362&w=2 for a
82e5a82f 7# nice description of what this is about.
70574634
FK
8
9
10test_description='Test criss-cross merge'
11. ./test-lib.sh
12
13test_expect_success 'prepare repository' \
14'echo "1
152
163
174
185
196
207
218
229" > file &&
a6080a0a 23git add file &&
70574634
FK
24git commit -m "Initial commit" file &&
25git branch A &&
26git branch B &&
27git checkout A &&
28echo "1
292
303
314
325
336
347
358 changed in B8, branch A
369" > file &&
37git commit -m "B8" file &&
38git checkout B &&
39echo "1
402
413 changed in C3, branch B
424
435
446
457
468
479
48" > file &&
49git commit -m "C3" file &&
50git branch C3 &&
d45366e8 51git merge -m "pre E3 merge" A &&
70574634
FK
52echo "1
532
543 changed in E3, branch B. New file size
554
565
576
587
598 changed in B8, branch A
609
61" > file &&
62git commit -m "E3" file &&
63git checkout A &&
d45366e8 64git merge -m "pre D8 merge" C3 &&
70574634
FK
65echo "1
662
673 changed in C3, branch B
684
695
706
717
728 changed in D8, branch A. New file size 2
739" > file &&
74git commit -m D8 file'
75
d45366e8 76test_expect_success 'Criss-cross merge' 'git merge -m "final merge" B'
70574634
FK
77
78cat > file-expect <<EOF
791
802
813 changed in E3, branch B. New file size
824
835
846
857
868 changed in D8, branch A. New file size 2
879
88EOF
89
90test_expect_success 'Criss-cross merge result' 'cmp file file-expect'
91
8ec0dd66
MV
92test_expect_success 'Criss-cross merge fails (-s resolve)' \
93'git reset --hard A^ &&
94test_must_fail git merge -s resolve -m "final merge" B'
95
70574634 96test_done