Browse Source

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 17 years ago committed by Junio C Hamano
parent
commit
24e8a3c946
  1. 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…
Cancel
Save