Skip to content

Commit c374b91

Browse files
committed
git-describe: use tags found in packed-refs correctly
When your refs are packed, "git-describe" can find the tag that is the best match without ever parsing the tag itself. But lookup_tag() in display_name() says "I've never seen it", creates an empty shell, and returns it. We need to make sure that we actually have parsed the tag data into it. Signed-off-by: Junio C Hamano <[email protected]>
1 parent f3ec549 commit c374b91

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 (!n->tag || !n->tag->tag)
159+
if (parse_tag(n->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)