[PATCH 3/7] parse_object_buffer: do not set object type
- From
Jeff King <peff@peff.net>
- Date
- Jul 11, 2014, 08:46 UTC
- Message-ID
- <20140711084625.GC5625@sigill.intra.peff.net>
- In-Reply-To
- <20140711084141.GA5521@sigill.intra.peff.net>
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 <peff@peff.net> --- object.c | 2 -- 1 file changed, 2 deletions(-)
diff --git a/object.c b/object.c index a950b85..472aa8d 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; }
-- 2.0.0.566.gfe3e6b2