diff options
Diffstat (limited to 'third_party/git/tag.c')
-rw-r--r-- | third_party/git/tag.c | 28 |
1 files changed, 3 insertions, 25 deletions
diff --git a/third_party/git/tag.c b/third_party/git/tag.c index 71b544467efa..5db870edb9e6 100644 --- a/third_party/git/tag.c +++ b/third_party/git/tag.c @@ -141,16 +141,7 @@ int parse_tag_buffer(struct repository *r, struct tag *item, const void *data, u if (item->object.parsed) return 0; - - if (item->tag) { - /* - * Presumably left over from a previous failed parse; - * clear it out in preparation for re-parsing (we'll probably - * hit the same error, which lets us tell our current caller - * about the problem). - */ - FREE_AND_NULL(item->tag); - } + item->object.parsed = 1; if (size < the_hash_algo->hexsz + 24) return -1; @@ -176,15 +167,10 @@ int parse_tag_buffer(struct repository *r, struct tag *item, const void *data, u } else if (!strcmp(type, tag_type)) { item->tagged = (struct object *)lookup_tag(r, &oid); } else { - return error("unknown tag type '%s' in %s", - type, oid_to_hex(&item->object.oid)); + error("Unknown type %s", type); + item->tagged = NULL; } - if (!item->tagged) - return error("bad tag pointer to %s in %s", - oid_to_hex(&oid), - oid_to_hex(&item->object.oid)); - if (bufptr + 4 < tail && starts_with(bufptr, "tag ")) ; /* good */ else @@ -201,7 +187,6 @@ int parse_tag_buffer(struct repository *r, struct tag *item, const void *data, u else item->date = 0; - item->object.parsed = 1; return 0; } @@ -227,10 +212,3 @@ int parse_tag(struct tag *item) free(data); return ret; } - -struct object_id *get_tagged_oid(struct tag *tag) -{ - if (!tag->tagged) - die("bad tag"); - return &tag->tagged->oid; -} |