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

Commit a872d83

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 14c3a3a commit a872d83

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

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

0 commit comments

Comments
 (0)