X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=tag.c;h=e574c4b7a496d3a1d113801214197a04d5c74d42;hb=d4072c9722d1ef28abe8ef0eb0b244017fff3f42;hp=2b25fc0e1dc53234e38e8ed8fdc1cb99fa4fd84a;hpb=5569bf9bbedd63a00780fc5c110e0cfab3aa97b9;p=git.git diff --git a/tag.c b/tag.c index 2b25fc0e..e574c4b7 100644 --- a/tag.c +++ b/tag.c @@ -3,6 +3,18 @@ const char *tag_type = "tag"; +struct object *deref_tag(struct object *o, const char *warn, int warnlen) +{ + while (o && o->type == tag_type) + o = parse_object(((struct tag *)o)->tagged->sha1); + if (!o && warn) { + if (!warnlen) + warnlen = strlen(warn); + error("missing object referenced by '%.*s'", warnlen, warn); + } + return o; +} + struct tag *lookup_tag(const unsigned char *sha1) { struct object *obj = lookup_object(sha1);