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
8 TEST_PASSES_SANITIZE_LEAK
=true
11 # verify that diffc.expect matches output of
12 # $(git diff -c --name-only HEAD HEAD^ HEAD^2)
14 git
diff -c --name-only HEAD HEAD^ HEAD^
2 >diffc.actual
&&
15 test_cmp diffc.expect diffc.actual
18 test_expect_success
'trivial merge - combine-diff empty' '
19 for i in $(test_seq 1 9)
22 git add $i.txt || return 1
24 git commit -m "init" &&
25 git checkout -b side &&
26 for i in $(test_seq 2 9)
28 echo $i/2 >>$i.txt || return 1
30 git commit -a -m "side 2-9" &&
33 git commit -a -m "main 1" &&
40 test_expect_success
'only one truly conflicting path' '
42 for i in $(test_seq 2 9)
44 echo $i/3 >>$i.txt || return 1
46 echo "4side" >>4.txt &&
47 git commit -a -m "side 2-9 +4" &&
49 for i in $(test_seq 1 9)
51 echo $i/3 >>$i.txt || return 1
53 echo "4main" >>4.txt &&
54 git commit -a -m "main 1-9 +4" &&
55 test_must_fail git merge side &&
64 git commit -m "merge side (2)" &&
65 echo 4.txt >diffc.expect &&
69 test_expect_success
'merge introduces new file' '
71 for i in $(test_seq 5 9)
73 echo $i/4 >>$i.txt || return 1
75 git commit -a -m "side 5-9" &&
77 for i in $(test_seq 1 3)
79 echo $i/4 >>$i.txt || return 1
81 git commit -a -m "main 1-3 +4hello" &&
83 echo "Hello World" >4hello.txt &&
86 echo 4hello.txt >diffc.expect &&
90 test_expect_success
'merge removed a file' '
92 for i in $(test_seq 5 9)
94 echo $i/5 >>$i.txt || return 1
96 git commit -a -m "side 5-9" &&
98 for i in $(test_seq 1 3)
100 echo $i/4 >>$i.txt || return 1
102 git commit -a -m "main 1-3" &&
105 git commit --amend &&
106 echo 4.txt >diffc.expect &&