X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=object.c;h=16793d9958a57664233b9e4468e112dfa1a8a915;hb=bfc07db5756bf7fe227b28daf8e19987819be514;hp=37d1363359eb54070ed4dc52b9e96d4ad9457db3;hpb=2b93bfac0f5bcabbf60f174f4e7bfa9e318e64d5;p=git.git diff --git a/object.c b/object.c index 37d136335..16793d995 100644 --- a/object.c +++ b/object.c @@ -160,8 +160,11 @@ struct object *parse_object_buffer(const unsigned char *sha1, enum object_type t parse_tag_buffer(tag, buffer, size); obj = &tag->object; } else { + warning("object %s has unknown type id %d\n", sha1_to_hex(sha1), type); obj = NULL; } + if (obj && obj->type == OBJ_NONE) + obj->type = type; *eaten_p = eaten; return obj; } @@ -176,6 +179,7 @@ struct object *parse_object(const unsigned char *sha1) if (buffer) { struct object *obj; if (check_sha1_signature(sha1, buffer, size, typename(type)) < 0) { + free(buffer); error("sha1 mismatch %s\n", sha1_to_hex(sha1)); return NULL; }