Browse Source

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
maint
Junio C Hamano 11 years ago
parent
commit
7e03f41663
  1. 3
      builtin/grep.c

3
builtin/grep.c

@ -872,6 +872,9 @@ int cmd_grep(int argc, const char **argv, const char *prefix) @@ -872,6 +872,9 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
if (len > 4 && is_dir_sep(pager[len - 5]))
pager += len - 4;

if (opt.ignore_case && !strcmp("less", pager))
string_list_append(&path_list, "-I");

if (!strcmp("less", pager) || !strcmp("vi", pager)) {
struct strbuf buf = STRBUF_INIT;
strbuf_addf(&buf, "+/%s%s",

Loading…
Cancel
Save