Skip to content

Commit

Permalink
git-grep: fix 'git grep -e $pattern' handling
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Junio C Hamano committed Sep 24, 2005
1 parent dc56bc0 commit c9fc748
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion git-grep.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

0 comments on commit c9fc748

Please sign in to comment.