Skip to content

Commit

Permalink
describe: re-fix display_name()
Browse files Browse the repository at this point in the history
It is implausible for lookup_tag() to return NULL in this particular
codepath but we should protect ourselves against a broken repository
better.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Junio C Hamano committed Mar 3, 2008
1 parent 870cf7d commit 3167d72
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion builtin-describe.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ static void display_name(struct commit_name *n)
{
if (n->prio == 2 && !n->tag) {
n->tag = lookup_tag(n->sha1);
if (parse_tag(n->tag) || !n->tag || !n->tag->tag)
if (!n->tag || parse_tag(n->tag) || !n->tag->tag)
die("annotated tag %s not available", n->path);
if (strcmp(n->tag->tag, n->path))
warning("tag '%s' is really '%s' here", n->tag->tag, n->path);
Expand Down

0 comments on commit 3167d72

Please sign in to comment.