summaryrefslogtreecommitdiff
path: root/t/t2203-add-intent.sh
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2018-05-26 12:08:43 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-05-29 03:36:31 (GMT)
commitba4e356109e5bf2b86bde335128c0ab4161268a9 (patch)
treec505c3f75f31d6b5f00a1d29b41cf84fce6d1115 /t/t2203-add-intent.sh
parentccdcbd54c4475c2238b310f7113ab3075b5abc9c (diff)
downloadgit-ba4e356109e5bf2b86bde335128c0ab4161268a9.zip
git-ba4e356109e5bf2b86bde335128c0ab4161268a9.tar.gz
git-ba4e356109e5bf2b86bde335128c0ab4161268a9.tar.bz2
diff: ignore --ita-[in]visible-in-index when diffing worktree-to-tree
This option is supposed to fix the diff of "diff-files" (not reporting ita entries as new files) and "diff-index --cached <tree>" (showing ita entries as present in the index with empty content) but not "diff-index <tree>". When --ita-invisible-in-index is set on "git diff-index <tree>", unpack_trees() will eventually call oneway_diff() on the ita entry with the same code flow as "diff-index --cached <tree>". We want to ignore the ita entry for "diff-index --cached <tree>" but not "diff-index <tree>" since the latter will examine and produce a diff based on worktree entry's (real) content, not ita index entry's (empty) content. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t2203-add-intent.sh')
-rwxr-xr-xt/t2203-add-intent.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/t/t2203-add-intent.sh b/t/t2203-add-intent.sh
index 78236dc..3ab07cb 100755
--- a/t/t2203-add-intent.sh
+++ b/t/t2203-add-intent.sh
@@ -70,7 +70,7 @@ test_expect_success 'i-t-a entry is simply ignored' '
git commit -m second &&
test $(git ls-tree HEAD -- nitfol | wc -l) = 0 &&
test $(git diff --name-only HEAD -- nitfol | wc -l) = 1 &&
- test $(git diff --name-only --ita-invisible-in-index HEAD -- nitfol | wc -l) = 0 &&
+ test $(git diff --name-only --ita-invisible-in-index HEAD -- nitfol | wc -l) = 1 &&
test $(git diff --name-only --ita-invisible-in-index -- nitfol | wc -l) = 1
'