Skip to content

Commit

Permalink
git-describe: use tags found in packed-refs correctly
Browse files Browse the repository at this point in the history
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 <gitster@pobox.com>
  • Loading branch information
Junio C Hamano committed Mar 3, 2008
1 parent f3ec549 commit c374b91
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 (!n->tag || !n->tag->tag)
if (parse_tag(n->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 c374b91

Please sign in to comment.