From 81dc223deba84341be9681d7a1a4a183e02e41d6 Mon Sep 17 00:00:00 2001 From: "Shawn O. Pearce" Date: Fri, 26 Dec 2008 14:02:01 -0800 Subject: describe: Avoid unnecessary warning when using --all MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In 212945d4 ("Teach git-describe to verify annotated tag names before output") git-describe learned how to output a warning if an annotated tag object was matched but its internal name doesn't match the local ref name. However, "git describe --all" causes the local ref name to be prefixed with "tags/", so we need to skip over this prefix before comparing the local ref name with the name recorded inside of the tag object. Patch-by: René Scharfe Signed-off-by: Shawn O. Pearce Signed-off-by: Junio C Hamano --- builtin-describe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'builtin-describe.c') diff --git a/builtin-describe.c b/builtin-describe.c index 3da99c1d06..22b989fd74 100644 --- a/builtin-describe.c +++ b/builtin-describe.c @@ -160,7 +160,7 @@ static void display_name(struct commit_name *n) n->tag = lookup_tag(n->sha1); 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)) + if (strcmp(n->tag->tag, all ? n->path + 5 : n->path)) warning("tag '%s' is really '%s' here", n->tag->tag, n->path); } -- cgit v1.2.3