From c35dfe858991ee1969870d2da9337a1da567157e Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Sun, 24 Apr 2005 14:22:09 -0700 Subject: Verify that the object type matches for tree/commit objects even before parsing. The type doesn't come from the parsing, the type also has to match the usage. --- commit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'commit.c') diff --git a/commit.c b/commit.c index c0dd689ea3..c6fdfd4919 100644 --- a/commit.c +++ b/commit.c @@ -15,7 +15,7 @@ struct commit *lookup_commit(unsigned char *sha1) ret->object.type = commit_type; return ret; } - if (obj->parsed && obj->type != commit_type) { + if (obj->type != commit_type) { error("Object %s is a %s, not a commit", sha1_to_hex(sha1), obj->type); return NULL; -- cgit v1.2.3