Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

Commit 408924d

Browse files
committed
git grep -O -i: if the pager is 'less', pass the '-i' option
Signed-off-by: Johannes Schindelin <[email protected]>
1 parent adbfbed commit 408924d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

builtin/grep.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -876,6 +876,9 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
876876
if (len > 4 && is_dir_sep(pager[len - 5]))
877877
pager += len - 4;
878878

879+
if (opt.ignore_case && !strcmp("less", pager))
880+
string_list_append(&path_list, "-i");
881+
879882
if (!strcmp("less", pager) || !strcmp("vi", pager)) {
880883
struct strbuf buf = STRBUF_INIT;
881884
strbuf_addf(&buf, "+/%s%s",

0 commit comments

Comments
 (0)