summaryrefslogtreecommitdiff
path: root/builtin/grep.c
diff options
context:
space:
mode:
Diffstat (limited to 'builtin/grep.c')
-rw-r--r--builtin/grep.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/builtin/grep.c b/builtin/grep.c
index e8f0f92cf7..159e65d47a 100644
--- a/builtin/grep.c
+++ b/builtin/grep.c
@@ -821,6 +821,8 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
/* Is it a rev? */
if (!get_sha1(arg, sha1)) {
struct object *object = parse_object_or_die(sha1, arg);
+ if (!seen_dashdash)
+ verify_non_filename(prefix, arg);
add_object_array(object, arg, &list);
continue;
}