summaryrefslogtreecommitdiff
path: root/tag.c
diff options
context:
space:
mode:
Diffstat (limited to 'tag.c')
-rw-r--r--tag.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/tag.c b/tag.c
index 79552c716c..82d841bf2d 100644
--- a/tag.c
+++ b/tag.c
@@ -41,14 +41,7 @@ struct tag *lookup_tag(const unsigned char *sha1)
struct object *obj = lookup_object(sha1);
if (!obj)
return create_object(sha1, 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 object_as_type(obj, OBJ_TAG, 0);
}
static unsigned long parse_tag_date(const char *buf, const char *tail)