X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=tag.c;h=82d841bf2df0990f124ca9020673352124f20561;hb=8ff226a9d5ee065fe52752e6032f63cb6e4beccb;hp=7b07921b30641994ab3a877b6b377c5ce1f40149;hpb=3dd108348f53d26acad91ce6059c94ec5a9390d2;p=thirdparty%2Fgit.git diff --git a/tag.c b/tag.c index 7b07921b30..82d841bf2d 100644 --- a/tag.c +++ b/tag.c @@ -40,15 +40,8 @@ struct tag *lookup_tag(const unsigned char *sha1) { struct object *obj = lookup_object(sha1); if (!obj) - return create_object(sha1, OBJ_TAG, alloc_tag_node()); - if (!obj->type) - obj->type = OBJ_TAG; - if (obj->type != OBJ_TAG) { - error("Object %s is a %s, not a tag", - sha1_to_hex(sha1), typename(obj->type)); - return NULL; - } - return (struct tag *) obj; + return create_object(sha1, alloc_tag_node()); + return object_as_type(obj, OBJ_TAG, 0); } static unsigned long parse_tag_date(const char *buf, const char *tail)