3 test_description='diff with unmerged index entries'
6 test_expect_success setup '
9 blob=$(echo $i | git hash-object --stdin) &&
10 eval "blob$i=$blob" &&
11 eval "m$i=\"100644 \$blob$i $i\"" || return 1
21 case "$path" in ooo) continue ;; esac
22 paths="$paths$path " &&
24 case "$b" in x) echo "$m1$p" ;; esac &&
25 case "$o" in x) echo "$m2$p" ;; esac &&
26 case "$t" in x) echo "$m3$p" ;; esac ||
30 done >ls-files-s.expect &&
31 git update-index --index-info <ls-files-s.expect &&
32 git ls-files -s >ls-files-s.actual &&
33 test_cmp ls-files-s.expect ls-files-s.actual
36 test_expect_success 'diff-files -0' '
40 echo ":000000 100644 $_z40 $_z40 U $path"
41 done >diff-files-0.expect &&
42 git diff-files -0 >diff-files-0.actual &&
43 test_cmp diff-files-0.expect diff-files-0.actual
46 test_expect_success 'diff-files -1' '
50 echo ":000000 100644 $_z40 $_z40 U $path" &&
52 x??) echo ":100644 100644 $blob1 $_z40 M $path"
54 done >diff-files-1.expect &&
55 git diff-files -1 >diff-files-1.actual &&
56 test_cmp diff-files-1.expect diff-files-1.actual
59 test_expect_success 'diff-files -2' '
63 echo ":000000 100644 $_z40 $_z40 U $path" &&
65 ?x?) echo ":100644 100644 $blob2 $_z40 M $path"
67 done >diff-files-2.expect &&
68 git diff-files -2 >diff-files-2.actual &&
69 test_cmp diff-files-2.expect diff-files-2.actual &&
70 git diff-files >diff-files-default-2.actual &&
71 test_cmp diff-files-2.expect diff-files-default-2.actual
74 test_expect_success 'diff-files -3' '
78 echo ":000000 100644 $_z40 $_z40 U $path" &&
80 ??x) echo ":100644 100644 $blob3 $_z40 M $path"
82 done >diff-files-3.expect &&
83 git diff-files -3 >diff-files-3.actual &&
84 test_cmp diff-files-3.expect diff-files-3.actual