From dad3f0607bf1c864f80723ab20b39527260f2c4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Scharfe?= 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 --- tag.h | 1 + 1 file changed, 1 insertion(+) (limited to 'tag.h') diff --git a/tag.h b/tag.h index 03265fbfe2..3ce8e72192 100644 --- a/tag.h +++ b/tag.h @@ -19,5 +19,6 @@ struct object *deref_tag(struct repository *r, struct object *, const char *, in struct object *deref_tag_noverify(struct object *); int gpg_verify_tag(const struct object_id *oid, const char *name_to_report, unsigned flags); +struct object_id *get_tagged_oid(struct tag *tag); #endif /* TAG_H */ -- cgit v1.2.3