aboutsummaryrefslogtreecommitdiffstats
path: root/packfile.c
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2019-09-05 21:59:42 +0200
committerJunio C Hamano <gitster@pobox.com>2019-09-05 14:11:34 -0700
commitc77722b3ea42a87381915f1203648a5f5d86c1ff (patch)
tree44b3e742d69e5e3334b5865ae1237cc9c045f258 /packfile.c
parentdad3f0607bf1c864f80723ab20b39527260f2c4f (diff)
downloadgit-c77722b3ea42a87381915f1203648a5f5d86c1ff.tar.gz
use get_tagged_oid()
Avoid derefencing ->tagged without checking for NULL by using the convenience wrapper for getting the ID of the tagged object. It die()s when encountering a broken tag instead of segfaulting. Signed-off-by: René Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'packfile.c')
-rw-r--r--packfile.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/packfile.c b/packfile.c
index fc43a6c52c..a62ab4cb17 100644
--- a/packfile.c
+++ b/packfile.c
@@ -2139,7 +2139,7 @@ static int add_promisor_object(const struct object_id *oid,
oidset_insert(set, &parents->item->object.oid);
} else if (obj->type == OBJ_TAG) {
struct tag *tag = (struct tag *) obj;
- oidset_insert(set, &tag->tagged->oid);
+ oidset_insert(set, get_tagged_oid(tag));
}
return 0;
}