Skip to content

Commit

Permalink
grep: make it clear i-t-a entries are ignored
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Nguyễn Thái Ngọc Duy authored and Junio C Hamano committed Dec 28, 2015
1 parent 895ff3b commit 4d55200
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion builtin/grep.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 4d55200

Please sign in to comment.