X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=tag.c;h=330d287924765c95dac428f040b104930c316b81;hb=404fdef22f1084141aeef5781d5a322554fed481;hp=56a49f4fe1f705ee70bc5318a504c35d1bce963e;hpb=ed287ab7fa71528e8de288988d1662eebae64002;p=git.git diff --git a/tag.c b/tag.c index 56a49f4fe..330d28792 100644 --- 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) {