summaryrefslogtreecommitdiff
path: root/builtin-diff.c
diff options
context:
space:
mode:
Diffstat (limited to 'builtin-diff.c')
-rw-r--r--builtin-diff.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/builtin-diff.c b/builtin-diff.c
index 27451d5613..6ac3d4b8ca 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);