diff options
author | Charles Bailey <cbailey32@bloomberg.net> | 2016-06-30 11:13:48 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-07-01 13:27:41 -0700 |
commit | b8e47d1acfa299299d1120241bdc6164867d1289 (patch) | |
tree | e0d9a43a3ef944291537b73410006d70210ac302 /t/t3900 | |
parent | t7810-grep.sh: fix a whitespace inconsistency (diff) | |
download | tgif-b8e47d1acfa299299d1120241bdc6164867d1289.tar.xz |
grep: fix grepping for "intent to add" files
This reverts commit 4d5520053 (grep: make it clear i-t-a entries are
ignored, 2015-12-27) and adds an alternative fix to maintain the -L
--cached behavior.
4d5520053 caused 'git grep' to no longer find matches in new files in
the working tree where the corresponding index entry had the "intent to
add" bit set, despite the fact that these files are tracked.
The content in the index of a file for which the "intent to add" bit is
set is considered indeterminate and not empty. For most grep queries we
want these to behave the same, however for -L --cached (files without a
match) we don't want to respond positively for "intent to add" files as
their contents are indeterminate. This is in contrast to files with
empty contents in the index (no lines implies no matches for any grep
query expression) which should be reported in the output of a grep -L
--cached invocation.
Add tests to cover this case and a few related cases which previously
lacked coverage.
Helped-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Charles Bailey <cbailey32@bloomberg.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t3900')
0 files changed, 0 insertions, 0 deletions