sane_grep: pass "-a" if grep accepts it

Newer versions of GNU grep is reported to be pickier when we feed a
non-ASCII input and break some Porcelain scripts.  As we know we do
not feed random binary file to our own sane_grep wrapper, allow us
to always pass "-a" by setting SANE_TEXT_GREP=-a Makefile variable
to work it around.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Junio C Hamano
2016-03-08 15:47:57 -08:00
parent 833e48259e
commit 71b401032b
4 changed files with 15 additions and 3 deletions

View File

@@ -168,11 +168,11 @@ git_pager() {
}
sane_grep () {
GREP_OPTIONS= LC_ALL=C grep "$@"
GREP_OPTIONS= LC_ALL=C grep @@SANE_TEXT_GREP@@ "$@"
}
sane_egrep () {
GREP_OPTIONS= LC_ALL=C egrep "$@"
GREP_OPTIONS= LC_ALL=C egrep @@SANE_TEXT_GREP@@ "$@"
}
is_bare_repository () {