3 test_description
='combined diff show only paths that are different to all parents'
5 GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
=main
6 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
10 # verify that diffc.expect matches output of
11 # $(git diff -c --name-only HEAD HEAD^ HEAD^2)
13 git
diff -c --name-only HEAD HEAD^ HEAD^
2 >diffc.actual
&&
14 test_cmp diffc.expect diffc.actual
17 test_expect_success
'trivial merge - combine-diff empty' '
18 for i in $(test_seq 1 9)
21 git add $i.txt || return 1
23 git commit -m "init" &&
24 git checkout -b side &&
25 for i in $(test_seq 2 9)
27 echo $i/2 >>$i.txt || return 1
29 git commit -a -m "side 2-9" &&
32 git commit -a -m "main 1" &&
39 test_expect_success
'only one truly conflicting path' '
41 for i in $(test_seq 2 9)
43 echo $i/3 >>$i.txt || return 1
45 echo "4side" >>4.txt &&
46 git commit -a -m "side 2-9 +4" &&
48 for i in $(test_seq 1 9)
50 echo $i/3 >>$i.txt || return 1
52 echo "4main" >>4.txt &&
53 git commit -a -m "main 1-9 +4" &&
54 test_must_fail git merge side &&
63 git commit -m "merge side (2)" &&
64 echo 4.txt >diffc.expect &&
68 test_expect_success
'merge introduces new file' '
70 for i in $(test_seq 5 9)
72 echo $i/4 >>$i.txt || return 1
74 git commit -a -m "side 5-9" &&
76 for i in $(test_seq 1 3)
78 echo $i/4 >>$i.txt || return 1
80 git commit -a -m "main 1-3 +4hello" &&
82 echo "Hello World" >4hello.txt &&
85 echo 4hello.txt >diffc.expect &&
89 test_expect_success
'merge removed a file' '
91 for i in $(test_seq 5 9)
93 echo $i/5 >>$i.txt || return 1
95 git commit -a -m "side 5-9" &&
97 for i in $(test_seq 1 3)
99 echo $i/4 >>$i.txt || return 1
101 git commit -a -m "main 1-3" &&
104 git commit --amend &&
105 echo 4.txt >diffc.expect &&