summaryrefslogtreecommitdiff
path: root/t/t4046-diff-unmerged.sh
diff options
context:
space:
mode:
Diffstat (limited to 't/t4046-diff-unmerged.sh')
-rwxr-xr-xt/t4046-diff-unmerged.sh22
1 files changed, 17 insertions, 5 deletions
diff --git a/t/t4046-diff-unmerged.sh b/t/t4046-diff-unmerged.sh
index ff7cfd8..ffaf693 100755
--- a/t/t4046-diff-unmerged.sh
+++ b/t/t4046-diff-unmerged.sh
@@ -1,6 +1,8 @@
#!/bin/sh
test_description='diff with unmerged index entries'
+
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success setup '
@@ -18,7 +20,7 @@ test_expect_success setup '
for t in o x
do
path="$b$o$t" &&
- case "$path" in ooo) continue ;; esac
+ case "$path" in ooo) continue ;; esac &&
paths="$paths$path " &&
p=" $path" &&
case "$b" in x) echo "$m1$p" ;; esac &&
@@ -37,7 +39,7 @@ test_expect_success 'diff-files -0' '
for path in $paths
do
>"$path" &&
- echo ":000000 100644 $ZERO_OID $ZERO_OID U $path"
+ echo ":000000 100644 $ZERO_OID $ZERO_OID U $path" || return 1
done >diff-files-0.expect &&
git diff-files -0 >diff-files-0.actual &&
test_cmp diff-files-0.expect diff-files-0.actual
@@ -50,7 +52,7 @@ test_expect_success 'diff-files -1' '
echo ":000000 100644 $ZERO_OID $ZERO_OID U $path" &&
case "$path" in
x??) echo ":100644 100644 $blob1 $ZERO_OID M $path"
- esac
+ esac || return 1
done >diff-files-1.expect &&
git diff-files -1 >diff-files-1.actual &&
test_cmp diff-files-1.expect diff-files-1.actual
@@ -63,7 +65,7 @@ test_expect_success 'diff-files -2' '
echo ":000000 100644 $ZERO_OID $ZERO_OID U $path" &&
case "$path" in
?x?) echo ":100644 100644 $blob2 $ZERO_OID M $path"
- esac
+ esac || return 1
done >diff-files-2.expect &&
git diff-files -2 >diff-files-2.actual &&
test_cmp diff-files-2.expect diff-files-2.actual &&
@@ -78,10 +80,20 @@ test_expect_success 'diff-files -3' '
echo ":000000 100644 $ZERO_OID $ZERO_OID U $path" &&
case "$path" in
??x) echo ":100644 100644 $blob3 $ZERO_OID M $path"
- esac
+ esac || return 1
done >diff-files-3.expect &&
git diff-files -3 >diff-files-3.actual &&
test_cmp diff-files-3.expect diff-files-3.actual
'
+test_expect_success 'diff --stat' '
+ for path in $paths
+ do
+ echo " $path | Unmerged" || return 1
+ done >diff-stat.expect &&
+ echo " 0 files changed" >>diff-stat.expect &&
+ git diff --cached --stat >diff-stat.actual &&
+ test_cmp diff-stat.expect diff-stat.actual
+'
+
test_done