Skip to content

Commit

Permalink
parse_object_buffer: do not set object type
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
  • Loading branch information
peff authored and gitster committed Jul 14, 2014
1 parent d36f51c commit 5af01ca
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions object.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 5af01ca

Please sign in to comment.