From: Jeff King Date: Sun, 13 Jul 2014 06:42:00 +0000 (-0400) Subject: parse_object_buffer: do not set object type X-Git-Tag: v2.1.0-rc0~12^2~4 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/5af01caa08700e389d49a81be15c7413abd4aa69?hp=--cc parse_object_buffer: do not set object type The only way that "obj" can be non-NULL is if it came from one of the lookup_* functions. These functions always ensure that the object has the expected type (and return NULL otherwise), so there is no need for us to set the type. Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- 5af01caa08700e389d49a81be15c7413abd4aa69 diff --git a/object.c b/object.c index a950b85146..472aa8d5be 100644 --- a/object.c +++ b/object.c @@ -213,8 +213,6 @@ struct object *parse_object_buffer(const unsigned char *sha1, enum object_type t warning("object %s has unknown type id %d", sha1_to_hex(sha1), type); obj = NULL; } - if (obj && obj->type == OBJ_NONE) - obj->type = type; return obj; }