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
Martin Koegler 2008-02-18 08:31:55 +01:00 committed by Junio C Hamano
parent affeef12fb
commit 24e8a3c946
1 changed files with 4 additions and 1 deletions

5
tag.c
View File

@ -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);