1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-27 02:56:12 +02:00

git-grep: fix 'git grep -e $pattern' handling

People typically say 'grep -e $pattern' because $pattern has a leading
dash which would be mistaken as a grep flag.  Make sure we pass -e in
front of $pattern when we invoke grep.

Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
Junio C Hamano 2005-09-24 15:09:48 -07:00
parent dc56bc0341
commit c9fc748f84

View File

@ -40,4 +40,4 @@ while : ; do
shift
done
git-ls-files -z "${git_flags[@]}" "$@" |
xargs -0 grep "${flags[@]}" "$pattern"
xargs -0 grep "${flags[@]}" -e "$pattern"