blame: handle deref_tag() returning NULL
Signed-off-by: René Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
e30b1525fb
commit
db7d07f610
6
blame.c
6
blame.c
@ -2670,7 +2670,7 @@ static struct commit *find_single_final(struct rev_info *revs,
|
|||||||
if (obj->flags & UNINTERESTING)
|
if (obj->flags & UNINTERESTING)
|
||||||
continue;
|
continue;
|
||||||
obj = deref_tag(revs->repo, obj, NULL, 0);
|
obj = deref_tag(revs->repo, obj, NULL, 0);
|
||||||
if (obj->type != OBJ_COMMIT)
|
if (!obj || obj->type != OBJ_COMMIT)
|
||||||
die("Non commit %s?", revs->pending.objects[i].name);
|
die("Non commit %s?", revs->pending.objects[i].name);
|
||||||
if (found)
|
if (found)
|
||||||
die("More than one commit to dig from %s and %s?",
|
die("More than one commit to dig from %s and %s?",
|
||||||
@ -2701,7 +2701,7 @@ static struct commit *dwim_reverse_initial(struct rev_info *revs,
|
|||||||
/* Is that sole rev a committish? */
|
/* Is that sole rev a committish? */
|
||||||
obj = revs->pending.objects[0].item;
|
obj = revs->pending.objects[0].item;
|
||||||
obj = deref_tag(revs->repo, obj, NULL, 0);
|
obj = deref_tag(revs->repo, obj, NULL, 0);
|
||||||
if (obj->type != OBJ_COMMIT)
|
if (!obj || obj->type != OBJ_COMMIT)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
/* Do we have HEAD? */
|
/* Do we have HEAD? */
|
||||||
@ -2737,7 +2737,7 @@ static struct commit *find_single_initial(struct rev_info *revs,
|
|||||||
if (!(obj->flags & UNINTERESTING))
|
if (!(obj->flags & UNINTERESTING))
|
||||||
continue;
|
continue;
|
||||||
obj = deref_tag(revs->repo, obj, NULL, 0);
|
obj = deref_tag(revs->repo, obj, NULL, 0);
|
||||||
if (obj->type != OBJ_COMMIT)
|
if (!obj || obj->type != OBJ_COMMIT)
|
||||||
die("Non commit %s?", revs->pending.objects[i].name);
|
die("Non commit %s?", revs->pending.objects[i].name);
|
||||||
if (found)
|
if (found)
|
||||||
die("More than one commit to dig up from, %s and %s?",
|
die("More than one commit to dig up from, %s and %s?",
|
||||||
|
@ -820,6 +820,8 @@ static int peel_to_commit_oid(struct object_id *oid_ret, void *cbdata)
|
|||||||
if (kind != OBJ_TAG)
|
if (kind != OBJ_TAG)
|
||||||
return -1;
|
return -1;
|
||||||
obj = deref_tag(r, parse_object(r, &oid), NULL, 0);
|
obj = deref_tag(r, parse_object(r, &oid), NULL, 0);
|
||||||
|
if (!obj)
|
||||||
|
return -1;
|
||||||
oidcpy(&oid, &obj->oid);
|
oidcpy(&oid, &obj->oid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user