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 <gitster@pobox.com>
Junio C Hamano committed
Mar 3, 2008 at 15:54 UTC
3167d7256505cdeace5293bc67f0d16657a9277e
1 file changed
+1
-1
builtin-describe.c
+1
-1
@@ -156,7 +156,7 @@ static void display_name(struct commit_name *n)
156
{
157
if (n->prio == 2 && !n->tag) {
158
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)
160
die("annotated tag %s not available", n->path);
161
if (strcmp(n->tag->tag, n->path))
162
warning("tag '%s' is really '%s' here", n->tag->tag, n->path);