general improvements
[gitweb.git] / tag.c
diff --git a/tag.c b/tag.c
index 3ae00ba1ab9343cfd236887c4b8e308d499ce537..bfa0e3143580f4f817fa0722a77224e81c58b615 100644 (file)
--- a/tag.c
+++ b/tag.c
@@ -102,8 +102,7 @@ struct tag *lookup_tag(struct repository *r, const struct object_id *oid)
 {
        struct object *obj = lookup_object(r, oid);
        if (!obj)
-               return create_object(r, oid->hash,
-                                    alloc_tag_node(r));
+               return create_object(r, oid, alloc_tag_node(r));
        return object_as_type(r, obj, OBJ_TAG, 0);
 }
 
@@ -213,3 +212,10 @@ int parse_tag(struct tag *item)
        free(data);
        return ret;
 }
+
+struct object_id *get_tagged_oid(struct tag *tag)
+{
+       if (!tag->tagged)
+               die("bad tag");
+       return &tag->tagged->oid;
+}