3 test_description
='diff with unmerged index entries'
5 TEST_PASSES_SANITIZE_LEAK
=true
8 test_expect_success setup
'
11 blob=$(echo $i | git hash-object --stdin) &&
12 eval "blob$i=$blob" &&
13 eval "m$i=\"100644 \$blob$i $i\"" || return 1
23 case "$path" in ooo) continue ;; esac &&
24 paths="$paths$path " &&
26 case "$b" in x) echo "$m1$p" ;; esac &&
27 case "$o" in x) echo "$m2$p" ;; esac &&
28 case "$t" in x) echo "$m3$p" ;; esac ||
32 done >ls-files-s.expect &&
33 git update-index --index-info <ls-files-s.expect &&
34 git ls-files -s >ls-files-s.actual &&
35 test_cmp ls-files-s.expect ls-files-s.actual
38 test_expect_success
'diff-files -0' '
42 echo ":000000 100644 $ZERO_OID $ZERO_OID U $path" || return 1
43 done >diff-files-0.expect &&
44 git diff-files -0 >diff-files-0.actual &&
45 test_cmp diff-files-0.expect diff-files-0.actual
48 test_expect_success
'diff-files -1' '
52 echo ":000000 100644 $ZERO_OID $ZERO_OID U $path" &&
54 x??) echo ":100644 100644 $blob1 $ZERO_OID M $path"
56 done >diff-files-1.expect &&
57 git diff-files -1 >diff-files-1.actual &&
58 test_cmp diff-files-1.expect diff-files-1.actual
61 test_expect_success
'diff-files -2' '
65 echo ":000000 100644 $ZERO_OID $ZERO_OID U $path" &&
67 ?x?) echo ":100644 100644 $blob2 $ZERO_OID M $path"
69 done >diff-files-2.expect &&
70 git diff-files -2 >diff-files-2.actual &&
71 test_cmp diff-files-2.expect diff-files-2.actual &&
72 git diff-files >diff-files-default-2.actual &&
73 test_cmp diff-files-2.expect diff-files-default-2.actual
76 test_expect_success
'diff-files -3' '
80 echo ":000000 100644 $ZERO_OID $ZERO_OID U $path" &&
82 ??x) echo ":100644 100644 $blob3 $ZERO_OID M $path"
84 done >diff-files-3.expect &&
85 git diff-files -3 >diff-files-3.actual &&
86 test_cmp diff-files-3.expect diff-files-3.actual