Skip to content

Commit fe0444b

Browse files
peffgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent fe24d39 commit fe0444b

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

object.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,6 @@ struct object *parse_object_buffer(const unsigned char *sha1, enum object_type t
213213
warning("object %s has unknown type id %d", sha1_to_hex(sha1), type);
214214
obj = NULL;
215215
}
216-
if (obj && obj->type == OBJ_NONE)
217-
obj->type = type;
218216
return obj;
219217
}
220218

0 commit comments

Comments
 (0)