Skip to content

Commit 7e03f41

Browse files
committed
Merge branch 'sk/spawn-less-case-insensitively-from-grep-O-i'
* sk/spawn-less-case-insensitively-from-grep-O-i: git grep -O -i: if the pager is 'less', pass the '-I' option
2 parents 7173ad7 + f7febbe commit 7e03f41

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
@@ -872,6 +872,9 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
872872
if (len > 4 && is_dir_sep(pager[len - 5]))
873873
pager += len - 4;
874874

875+
if (opt.ignore_case && !strcmp("less", pager))
876+
string_list_append(&path_list, "-I");
877+
875878
if (!strcmp("less", pager) || !strcmp("vi", pager)) {
876879
struct strbuf buf = STRBUF_INIT;
877880
strbuf_addf(&buf, "+/%s%s",

0 commit comments

Comments
 (0)