daemon: further tweaks.
[gitweb.git] / git-grep.sh
index e7a35ebd707c6ef485a26f4e1ece57fa248e0106..44c16130bd93fea8b6f172f1614115801f8df2d9 100755 (executable)
@@ -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"