aboutsummaryrefslogtreecommitdiff
path: root/tree.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-24 14:22:09 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-24 14:22:09 -0700
commitc35dfe858991ee1969870d2da9337a1da567157e (patch)
treec7957a1345ea647b825c3a222d0c7e66cee2c311 /tree.c
parentd32987be618181db1f435a5c0a1bea85e90c7c7d (diff)
downloadgit-c35dfe858991ee1969870d2da9337a1da567157e.tar.gz
git-c35dfe858991ee1969870d2da9337a1da567157e.tar.xz
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.
Diffstat (limited to 'tree.c')
-rw-r--r--tree.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tree.c b/tree.c
index 23476da7d..3537c1155 100644
--- a/tree.c
+++ b/tree.c
@@ -80,7 +80,7 @@ struct tree *lookup_tree(unsigned char *sha1)
ret->object.type = tree_type;
return ret;
}
- if (obj->parsed && obj->type != tree_type) {
+ if (obj->type != tree_type) {
error("Object %s is a %s, not a tree",
sha1_to_hex(sha1), obj->type);
return NULL;