mirror of
https://github.com/git/git.git
synced 2024-10-28 04:49:43 +01:00
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>
This commit is contained in:
parent
affeef12fb
commit
24e8a3c946
1 changed files with 4 additions and 1 deletions
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)
|
||||
{
|
||||
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);
|
||||
|
|
Loading…
Reference in a new issue