Andrew's git
/
gitweb.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
commit
grep
author
committer
pickaxe
?
re
daemon: further tweaks.
[gitweb.git]
/
git-grep.sh
diff --git
a/git-grep.sh
b/git-grep.sh
index e7a35ebd707c6ef485a26f4e1ece57fa248e0106..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[@]}" -e "$pattern"