Skip to content

Commit 3167d72

Browse files
committed
describe: re-fix display_name()
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 <[email protected]>
1 parent 870cf7d commit 3167d72

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

builtin-describe.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ static void display_name(struct commit_name *n)
156156
{
157157
if (n->prio == 2 && !n->tag) {
158158
n->tag = lookup_tag(n->sha1);
159-
if (parse_tag(n->tag) || !n->tag || !n->tag->tag)
159+
if (!n->tag || parse_tag(n->tag) || !n->tag->tag)
160160
die("annotated tag %s not available", n->path);
161161
if (strcmp(n->tag->tag, n->path))
162162
warning("tag '%s' is really '%s' here", n->tag->tag, n->path);

0 commit comments

Comments
 (0)