refs: pass NULL to refs_read_ref_full() because object ID is not needed
[alt-git.git] / t / t6021-merge-criss-cross.sh
blobd254e020b6d13f4955e0e10141e6f5bc4722a13f
1 #!/bin/sh
3 # Copyright (c) 2005 Fredrik Kuivinen
6 # See https://lore.kernel.org/git/Pine.LNX.4.44.0504271254120.4678-100000@wax.eds.org/ for a
7 # nice description of what this is about.
10 test_description='Test criss-cross merge'
11 . ./test-lib.sh
13 test_expect_success 'prepare repository' \
14 'echo "1
22 9" > file &&
23 git add file &&
24 git commit -m "Initial commit" file &&
25 git branch A &&
26 git branch B &&
27 git checkout A &&
28 echo "1
35 8 changed in B8, branch A
36 9" > file &&
37 git commit -m "B8" file &&
38 git checkout B &&
39 echo "1
41 3 changed in C3, branch B
48 " > file &&
49 git commit -m "C3" file &&
50 git branch C3 &&
51 git merge -m "pre E3 merge" A &&
52 echo "1
54 3 changed in E3, branch B. New file size
59 8 changed in B8, branch A
61 " > file &&
62 git commit -m "E3" file &&
63 git checkout A &&
64 git merge -m "pre D8 merge" C3 &&
65 echo "1
67 3 changed in C3, branch B
72 8 changed in D8, branch A. New file size 2
73 9" > file &&
74 git commit -m D8 file'
76 test_expect_success 'Criss-cross merge' 'git merge -m "final merge" B'
78 cat > file-expect <<EOF
81 3 changed in E3, branch B. New file size
86 8 changed in D8, branch A. New file size 2
88 EOF
90 test_expect_success 'Criss-cross merge result' 'cmp file file-expect'
92 test_expect_success 'Criss-cross merge fails (-s resolve)' \
93 'git reset --hard A^ &&
94 test_must_fail git merge -s resolve -m "final merge" B'
96 test_done