3 # Copyright (c) Linus Torvalds, 2005
11 --cached|
--deleted|
--others|
--killed|\
12 --ignored|
--exclude=*|\
13 --exclude-from=*|\
--exclude-per-directory=*)
14 git_flags
=("${git_flags[@]}" "$1")
21 flags
=("${flags[@]}" "$1" "$2")
25 # The rest are git-ls-files paths (or flags)
30 flags
=("${flags[@]}" "$1")
33 if [ -z "$pattern" ]; then
43 echo >&2 "usage: 'git grep <pattern> [pathspec*]'"
46 git-ls-files
-z "${git_flags[@]}" "$@" |
47 xargs -0 grep "${flags[@]}" -e "$pattern"