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>
Nguyễn Thái Ngọc Duy committed
Dec 27, 2015 at 08:51 UTC
4d552005323034c1d6311796ac1074e9a4b4b57e
1 file changed
+1
-1
builtin/grep.c
+1
-1
@@ -375,7 +375,7 @@ static int grep_cache(struct grep_opt *opt, const struct pathspec *pathspec, int
375
376
for (nr = 0; nr < active_nr; nr++) {
377
const struct cache_entry *ce = active_cache[nr];
378
- if (!S_ISREG(ce->ce_mode))
378
+ if (!S_ISREG(ce->ce_mode) || ce_intent_to_add(ce))
379
continue;
380
if (!ce_path_match(ce, pathspec, NULL))
381
continue;