Skip to content

Commit

Permalink
deref_tag: handle tag->tagged = NULL
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Martin Koegler authored and Junio C Hamano committed Feb 18, 2008
1 parent affeef1 commit 24e8a3c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tag.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ const char *tag_type = "tag";
struct object *deref_tag(struct object *o, const char *warn, int warnlen)
{
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 (!warnlen)
warnlen = strlen(warn);
Expand Down

0 comments on commit 24e8a3c

Please sign in to comment.