grep: pass -I (ignore binary) down to external grep
authorJunio C Hamano <gitster@pobox.com>
Mon, 2 Feb 2009 18:58:20 +0000 (10:58 -0800)
committerJunio C Hamano <gitster@pobox.com>
Mon, 2 Feb 2009 18:58:20 +0000 (10:58 -0800)
We forgot to pass this option to the external grep process.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-grep.c

index 3a51662a35878ae6b5965c90abb747b5b27c5493..d3cc75e3a47bed0d44d1981a6f609f24558a9e1b 100644 (file)
@@ -289,6 +289,8 @@ static int external_grep(struct grep_opt *opt, const char **paths, int cached)
                push_arg("-E");
        if (opt->regflags & REG_ICASE)
                push_arg("-i");
+       if (opt->binary == GREP_BINARY_NOMATCH)
+               push_arg("-I");
        if (opt->word_regexp)
                push_arg("-w");
        if (opt->name_only)