1
0
mirror of https://github.com/git/git.git synced 2024-11-18 23:13:58 +01:00

grep: prefer builtin over external one when coloring results

As far as I know, not all grep programs support coloring, so we should
rely on builtin grep. If you want external grep, set
color.grep.external to empty string.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Nguyễn Thái Ngọc Duy 2009-03-16 13:20:04 +11:00 committed by Junio C Hamano
parent 747a322bcc
commit 6e89ec0f1e

@ -825,6 +825,8 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
}
}
if (opt.color && !opt.color_external)
builtin_grep = 1;
if (!opt.pattern_list)
die("no pattern given.");
if ((opt.regflags != REG_NEWLINE) && opt.fixed)