X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=tag.c;h=91913332709eb67252a776ddd1995e183a1a5bf5;hb=885a86abe2e9f7b96a4e2012183c6751635840aa;hp=f390ee703036bc74d6447d7e96c828310a948c2b;hpb=210a0be504829bad5a2821488d3c25cc406fed4a;p=git.git diff --git a/tag.c b/tag.c index f390ee70..91913332 100644 --- a/tag.c +++ b/tag.c @@ -5,7 +5,7 @@ const char *tag_type = "tag"; struct object *deref_tag(struct object *o, const char *warn, int warnlen) { - while (o && o->type == tag_type) + while (o && o->type == TYPE_TAG) o = parse_object(((struct tag *)o)->tagged->sha1); if (!o && warn) { if (!warnlen) @@ -21,14 +21,14 @@ struct tag *lookup_tag(const unsigned char *sha1) if (!obj) { struct tag *ret = xcalloc(1, sizeof(struct tag)); created_object(sha1, &ret->object); - ret->object.type = tag_type; + ret->object.type = TYPE_TAG; return ret; } if (!obj->type) - obj->type = tag_type; - if (obj->type != tag_type) { - error("Object %s is a %s, not a tree", - sha1_to_hex(sha1), obj->type); + obj->type = TYPE_TAG; + if (obj->type != TYPE_TAG) { + error("Object %s is a %s, not a tree", + sha1_to_hex(sha1), typename(obj->type)); return NULL; } return (struct tag *) obj;