git.el: Preserve file marks when doing a full refresh.
[gitweb.git] / tag.c
diff --git a/tag.c b/tag.c
index e11a4cdc497064f1aa5380fdfd3b8f020e44358b..bbacd59a23f7994980f4bf017324833ca3d4adb3 100644 (file)
--- a/tag.c
+++ b/tag.c
@@ -20,13 +20,9 @@ struct object *deref_tag(struct object *o, const char *warn, int warnlen)
 
 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) {