index e11a4cdc497064f1aa5380fdfd3b8f020e44358b..bbacd59a23f7994980f4bf017324833ca3d4adb3 100644 (file)
--- a/tag.c
+++ b/tag.c
struct tag *lookup_tag(const unsigned char *sha1)
{
- struct object *obj = lookup_object(sha1);
- if (!obj) {
- struct tag *ret = alloc_tag_node();
- created_object(sha1, &ret->object);
- ret->object.type = OBJ_TAG;
- return ret;
- }
+ 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) {