aboutsummaryrefslogtreecommitdiff
path: root/builtin-describe.c
diff options
context:
space:
mode:
authorThomas Rast <trast@student.ethz.ch>2009-11-18 14:32:26 +0100
committerJunio C Hamano <gitster@pobox.com>2009-11-20 21:58:11 -0800
commit7a0d61bb45055cacf85111e7c48dfb9054b0abb0 (patch)
treef5e4e43aa276ace21b441fa27829ea0fe434787c /builtin-describe.c
parent75b9a8a6d5aee29b1d0d03935531081e6180c0db (diff)
downloadgit-7a0d61bb45055cacf85111e7c48dfb9054b0abb0.tar.gz
git-7a0d61bb45055cacf85111e7c48dfb9054b0abb0.tar.xz
describe: do not use unannotated tag even if exact match
4d23660 (describe: when failing, tell the user about options that work, 2009-10-28) forgot to update the shortcut path where the code detected and used a possible exact match. This means that an unannotated tag on HEAD would be used by 'git describe'. Guard this code path against the new circumstances, where unannotated tags can be present in ->util even if we're not actually planning to use them. While there, also add some tests for --all. Reported by 'yashi' on IRC. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-describe.c')
-rw-r--r--builtin-describe.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin-describe.c b/builtin-describe.c
index d4efb10dd..71be2a936 100644
--- a/builtin-describe.c
+++ b/builtin-describe.c
@@ -200,7 +200,7 @@ static void describe(const char *arg, int last_one)
die("%s is not a valid '%s' object", arg, commit_type);
n = cmit->util;
- if (n) {
+ if (n && (tags || all || n->prio == 2)) {
/*
* Exact match to an existing ref.
*/