X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=builtin-diff.c;h=6ac3d4b8ca23e7c4d724b22fd3222005d8fe3df8;hb=885a86abe2e9f7b96a4e2012183c6751635840aa;hp=27451d56134e08364c33c26d5074693dd4437d31;hpb=210a0be504829bad5a2821488d3c25cc406fed4a;p=git.git diff --git a/builtin-diff.c b/builtin-diff.c index 27451d56..6ac3d4b8 100644 --- a/builtin-diff.c +++ b/builtin-diff.c @@ -303,9 +303,9 @@ int cmd_diff(int argc, const char **argv, char **envp) obj = deref_tag(obj, NULL, 0); if (!obj) die("invalid object '%s' given.", name); - if (!strcmp(obj->type, commit_type)) + if (obj->type == TYPE_COMMIT) obj = &((struct commit *)obj)->tree->object; - if (!strcmp(obj->type, tree_type)) { + if (obj->type == TYPE_TREE) { if (ARRAY_SIZE(ent) <= ents) die("more than %d trees given: '%s'", (int) ARRAY_SIZE(ent), name); @@ -315,7 +315,7 @@ int cmd_diff(int argc, const char **argv, char **envp) ents++; continue; } - if (!strcmp(obj->type, blob_type)) { + if (obj->type == TYPE_BLOB) { if (2 <= blobs) die("more than two blobs given: '%s'", name); memcpy(blob[blobs].sha1, obj->sha1, 20);