index 2b25fc0e1dc53234e38e8ed8fdc1cb99fa4fd84a..e574c4b7a496d3a1d113801214197a04d5c74d42 100644 (file)
--- a/tag.c
+++ b/tag.c
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);