use parse_object_or_die instead of die("bad object")
[git/git.git] / builtin / grep.c
index 0654e0b..08ea5fd 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;
                }