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 if test "$path" != ooo
25 paths="$paths$path " &&
27 case "$b" in x) echo "$m1$p" ;; esac &&
28 case "$o" in x) echo "$m2$p" ;; esac &&
29 case "$t" in x) echo "$m3$p" ;; esac ||
34 done >ls-files-s.expect &&
35 git update-index --index-info <ls-files-s.expect &&
36 git ls-files -s >ls-files-s.actual &&
37 test_cmp ls-files-s.expect ls-files-s.actual
40 test_expect_success
'diff-files -0' '
44 echo ":000000 100644 $ZERO_OID $ZERO_OID U $path" || return 1
45 done >diff-files-0.expect &&
46 git diff-files -0 >diff-files-0.actual &&
47 test_cmp diff-files-0.expect diff-files-0.actual
50 test_expect_success
'diff-files -1' '
54 echo ":000000 100644 $ZERO_OID $ZERO_OID U $path" &&
56 x??) echo ":100644 100644 $blob1 $ZERO_OID M $path"
58 done >diff-files-1.expect &&
59 git diff-files -1 >diff-files-1.actual &&
60 test_cmp diff-files-1.expect diff-files-1.actual
63 test_expect_success
'diff-files -2' '
67 echo ":000000 100644 $ZERO_OID $ZERO_OID U $path" &&
69 ?x?) echo ":100644 100644 $blob2 $ZERO_OID M $path"
71 done >diff-files-2.expect &&
72 git diff-files -2 >diff-files-2.actual &&
73 test_cmp diff-files-2.expect diff-files-2.actual &&
74 git diff-files >diff-files-default-2.actual &&
75 test_cmp diff-files-2.expect diff-files-default-2.actual
78 test_expect_success
'diff-files -3' '
82 echo ":000000 100644 $ZERO_OID $ZERO_OID U $path" &&
84 ??x) echo ":100644 100644 $blob3 $ZERO_OID M $path"
86 done >diff-files-3.expect &&
87 git diff-files -3 >diff-files-3.actual &&
88 test_cmp diff-files-3.expect diff-files-3.actual
91 test_expect_success
'diff --stat' '
94 echo " $path | Unmerged" || return 1
95 done >diff-stat.expect &&
96 echo " 0 files changed" >>diff-stat.expect &&
97 git diff --cached --stat >diff-stat.actual &&
98 test_cmp diff-stat.expect diff-stat.actual
101 test_expect_success
'diff --quiet' '
102 test_expect_code 1 git diff --cached --quiet
105 test_expect_success
'diff --quiet --ignore-all-space' '
106 test_expect_code 1 git diff --cached --quiet --ignore-all-space