@matheusbsbs / matheus-bagliano / commits / 540bf654d0
Fork 0

Allow finding things that begin with a dash in 'git grep'

Signed-off-by: Junio C Hamano <junkio@cox.net>

Junio C Hamano committed Sep 12, 2005 at 13:24 UTC 540bf654d007b3289adec37e3008c588ba677e25
1 file changed +6 -1
git-grep.sh
+6 -1
@@ -7,6 +7,11 @@ while :; do
7 flags="$flags $pattern"
8 shift
9 ;;
10 + -e)
11 + pattern="$2"
12 + shift
13 + break
14 + ;;
15 -*)
16 echo "unknown flag $pattern" >&2
17 exit 1
@@ -17,4 +22,4 @@ while :; do
22 esac
23 done
24 shift
20 -git-ls-files -z "$@" | xargs -0 grep $flags "$pattern"
25 +git-ls-files -z "$@" | xargs -0 grep $flags -e "$pattern"