summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2015-12-27 01:51:32 (GMT)
committerJunio C Hamano <gitster@pobox.com>2015-12-28 20:42:35 (GMT)
commit4d552005323034c1d6311796ac1074e9a4b4b57e (patch)
tree2ff13df9c3c489567253b8b1a059e1dc0950246b
parent895ff3b2c73c737b699a921fe71cea4dadefab7b (diff)
downloadgit-4d552005323034c1d6311796ac1074e9a4b4b57e.zip
git-4d552005323034c1d6311796ac1074e9a4b4b57e.tar.gz
git-4d552005323034c1d6311796ac1074e9a4b4b57e.tar.bz2
grep: make it clear i-t-a entries are ignored
The expression "!S_ISREG(ce)" covers i-t-a entries as well because ce->ce_mode would be zero then. I could make a comment saying that, but it's probably better just to comment with code, in case i-t-a entry content changes in future. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--builtin/grep.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/grep.c b/builtin/grep.c
index d04f440..f508179 100644
--- a/builtin/grep.c
+++ b/builtin/grep.c
@@ -375,7 +375,7 @@ static int grep_cache(struct grep_opt *opt, const struct pathspec *pathspec, int
for (nr = 0; nr < active_nr; nr++) {
const struct cache_entry *ce = active_cache[nr];
- if (!S_ISREG(ce->ce_mode))
+ if (!S_ISREG(ce->ce_mode) || ce_intent_to_add(ce))
continue;
if (!ce_path_match(ce, pathspec, NULL))
continue;