deref_tag: handle tag->tagged = NULL
Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>maint
parent
affeef12fb
commit
24e8a3c946
5
tag.c
5
tag.c
|
@ -9,7 +9,10 @@ const char *tag_type = "tag";
|
||||||
struct object *deref_tag(struct object *o, const char *warn, int warnlen)
|
struct object *deref_tag(struct object *o, const char *warn, int warnlen)
|
||||||
{
|
{
|
||||||
while (o && o->type == OBJ_TAG)
|
while (o && o->type == OBJ_TAG)
|
||||||
o = parse_object(((struct tag *)o)->tagged->sha1);
|
if (((struct tag *)o)->tagged)
|
||||||
|
o = parse_object(((struct tag *)o)->tagged->sha1);
|
||||||
|
else
|
||||||
|
o = NULL;
|
||||||
if (!o && warn) {
|
if (!o && warn) {
|
||||||
if (!warnlen)
|
if (!warnlen)
|
||||||
warnlen = strlen(warn);
|
warnlen = strlen(warn);
|
||||||
|
|
Loading…
Reference in New Issue