X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=builtin-grep.c;h=9806499263dcb92c7a6903ead36646baf676b178;hb=885a86abe2e9f7b96a4e2012183c6751635840aa;hp=5fac5701e6ccebdbe83b00d2e2df19343d3aea0e;hpb=210a0be504829bad5a2821488d3c25cc406fed4a;p=git.git diff --git a/builtin-grep.c b/builtin-grep.c index 5fac5701..98064992 100644 --- a/builtin-grep.c +++ b/builtin-grep.c @@ -630,10 +630,9 @@ static int grep_tree(struct grep_opt *opt, const char **paths, static int grep_object(struct grep_opt *opt, const char **paths, struct object *obj, const char *name) { - if (!strcmp(obj->type, blob_type)) + if (obj->type == TYPE_BLOB) return grep_sha1(opt, obj->sha1, name); - if (!strcmp(obj->type, commit_type) || - !strcmp(obj->type, tree_type)) { + if (obj->type == TYPE_COMMIT || obj->type == TYPE_TREE) { struct tree_desc tree; void *data; int hit; @@ -646,7 +645,7 @@ static int grep_object(struct grep_opt *opt, const char **paths, free(data); return hit; } - die("unable to grep from object of type %s", obj->type); + die("unable to grep from object of type %s", typename(obj->type)); } static const char builtin_grep_usage[] =