summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4ed19a3)
raw | patch | inline | side by side (parent: 4ed19a3)
author | Shawn O. Pearce <spearce@spearce.org> | |
Fri, 26 Dec 2008 22:02:01 +0000 (14:02 -0800) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sat, 27 Dec 2008 00:37:53 +0000 (16:37 -0800) |
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 <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
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 <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-describe.c | patch | blob | history | |
t/t6120-describe.sh | patch | blob | history |
diff --git a/builtin-describe.c b/builtin-describe.c
index 3da99c1d06f1eeb85e760036dc881282558603d6..22b989fd74098d355efc78a9fbc2a60461adc6b9 100644 (file)
--- a/builtin-describe.c
+++ b/builtin-describe.c
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);
}
diff --git a/t/t6120-describe.sh b/t/t6120-describe.sh
index c6bfef5f47f41cee2011af664123e30308c7af49..113a085cb9c0df458cb49b872070da088ca8dd0b 100755 (executable)
--- a/t/t6120-describe.sh
+++ b/t/t6120-describe.sh
check_describe B-0-* --long HEAD^^2^
check_describe A-3-* --long HEAD^^2
+: >err.expect
+check_describe A --all A^0
+test_expect_success 'no warning was displayed for A' '
+ test_cmp err.expect err.actual
+'
+
test_expect_success 'rename tag A to Q locally' '
mv .git/refs/tags/A .git/refs/tags/Q
'