From 3167d7256505cdeace5293bc67f0d16657a9277e Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Mon, 3 Mar 2008 15:54:23 -0800 Subject: [PATCH] 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 --- builtin-describe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin-describe.c b/builtin-describe.c index 43be67182..7a5ab012b 100644 --- a/builtin-describe.c +++ b/builtin-describe.c @@ -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); -- 2.26.2