summaryrefslogtreecommitdiff
path: root/t/t4013-diff-various.sh
diff options
context:
space:
mode:
authorSergey Organov <sorganov@gmail.com>2021-05-20 21:46:58 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-05-21 00:24:14 (GMT)
commite0b16421b17fffa2544eebfcb570fdb766fd0bc4 (patch)
treecd0d3550f4d6ab73677ac8319b2ca5c1470a1338 /t/t4013-diff-various.sh
parent3ae7fe2b0f8528305bc871738dd12cde23024556 (diff)
downloadgit-e0b16421b17fffa2544eebfcb570fdb766fd0bc4.zip
git-e0b16421b17fffa2544eebfcb570fdb766fd0bc4.tar.gz
git-e0b16421b17fffa2544eebfcb570fdb766fd0bc4.tar.bz2
t4013: test "git diff-index -m"
-m in "git diff-index" means "match missing", that differs from its meaning in "git diff". Let's check it in diff-index. Signed-off-by: Sergey Organov <sorganov@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4013-diff-various.sh')
-rwxr-xr-xt/t4013-diff-various.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/t/t4013-diff-various.sh b/t/t4013-diff-various.sh
index bdc23b1..e561a8e 100755
--- a/t/t4013-diff-various.sh
+++ b/t/t4013-diff-various.sh
@@ -494,6 +494,19 @@ test_expect_success 'git config log.diffMerges first-parent vs -m' '
test_cmp expected actual
'
+# -m in "git diff-index" means "match missing", that differs
+# from its meaning in "git diff". Let's check it in diff-index.
+# The line in the output for removed file should disappear when
+# we provide -m in diff-index.
+test_expect_success 'git diff-index -m' '
+ rm -f file1 &&
+ git diff-index HEAD >without-m &&
+ lines_count=$(wc -l <without-m) &&
+ git diff-index -m HEAD >with-m &&
+ git restore file1 &&
+ test_line_count = $((lines_count - 1)) with-m
+'
+
test_expect_success 'log -S requires an argument' '
test_must_fail git log -S
'