diff options
author | René Scharfe <l.s.r@web.de> | 2020-10-11 18:03:37 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-10-12 12:25:14 -0700 |
commit | db7d07f61057e94e2a3683ca10d67a2a219f542f (patch) | |
tree | ff44066f9388f3ed228af7513e61cb9017b25dc5 /blame.c | |
parent | grep: handle deref_tag() returning NULL (diff) | |
download | tgif-db7d07f61057e94e2a3683ca10d67a2a219f542f.tar.xz |
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>
Diffstat (limited to 'blame.c')
-rw-r--r-- | blame.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -2670,7 +2670,7 @@ static struct commit *find_single_final(struct rev_info *revs, if (obj->flags & UNINTERESTING) continue; 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); if (found) 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? */ obj = revs->pending.objects[0].item; obj = deref_tag(revs->repo, obj, NULL, 0); - if (obj->type != OBJ_COMMIT) + if (!obj || obj->type != OBJ_COMMIT) return NULL; /* Do we have HEAD? */ @@ -2737,7 +2737,7 @@ static struct commit *find_single_initial(struct rev_info *revs, if (!(obj->flags & UNINTERESTING)) continue; 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); if (found) die("More than one commit to dig up from, %s and %s?", |