Andrew's git
/
gitweb.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
commit
grep
author
committer
pickaxe
?
re
git.c: two fixes, gitsetenv type and off-by-one error.
[gitweb.git]
/
git-grep.sh
diff --git
a/git-grep.sh
b/git-grep.sh
index 51924fd7c38a4fd70f59069a3eecbfe787626375..44c16130bd93fea8b6f172f1614115801f8df2d9 100755
(executable)
--- a/
git-grep.sh
+++ b/
git-grep.sh
@@
-39,5
+39,9
@@
while : ; do
esac
shift
done
+[ "$pattern" ] || {
+ echo >&2 "usage: 'git grep <pattern> [pathspec*]'"
+ exit 1
+}
git-ls-files -z "${git_flags[@]}" "$@" |
- xargs -0 grep "${flags[@]}" "$pattern"
+ xargs -0 grep "${flags[@]}"
-e
"$pattern"