use parse_object_or_die instead of die("bad object")
[gitweb.git] / builtin / grep.c
index 0654e0b0f693f9cdd4ba2d7f84c110f7ef8b11b4..08ea5fdec844604e6a48b9a5f6c7bbc74df651dc 100644 (file)
@@ -898,9 +898,7 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
                unsigned char sha1[20];
                /* Is it a rev? */
                if (!get_sha1(arg, sha1)) {
-                       struct object *object = parse_object(sha1);
-                       if (!object)
-                               die(_("bad object %s"), arg);
+                       struct object *object = parse_object_or_die(sha1, arg);
                        add_object_array(object, arg, &list);
                        continue;
                }