From dad3f0607bf1c864f80723ab20b39527260f2c4f Mon Sep 17 00:00:00 2001 From: René Scharfe Date: Thu, 5 Sep 2019 21:55:55 +0200 Subject: tag: factor out get_tagged_oid() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add a function for accessing the ID of the object referenced by a tag safely, i.e. without causing a segfault when encountering a broken tag where ->tagged is NULL. Signed-off-by: René Scharfe Signed-off-by: Junio C Hamano --- pack-bitmap.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'pack-bitmap.c') diff --git a/pack-bitmap.c b/pack-bitmap.c index ed2befaac6..30842e1e74 100644 --- a/pack-bitmap.c +++ b/pack-bitmap.c @@ -709,9 +709,7 @@ struct bitmap_index *prepare_bitmap_walk(struct rev_info *revs) else object_list_insert(object, &wants); - if (!tag->tagged) - die("bad tag"); - object = parse_object_or_die(&tag->tagged->oid, NULL); + object = parse_object_or_die(get_tagged_oid(tag), NULL); } if (object->flags & UNINTERESTING) -- cgit v1.3