summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--builtin-describe.c2
-rwxr-xr-xt/t6120-describe.sh6
2 files changed, 7 insertions, 1 deletions
diff --git a/builtin-describe.c b/builtin-describe.c
index d4efb10ddf..71be2a9364 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.
*/
diff --git a/t/t6120-describe.sh b/t/t6120-describe.sh
index c050f94bc6..065deadc29 100755
--- a/t/t6120-describe.sh
+++ b/t/t6120-describe.sh
@@ -92,12 +92,18 @@ check_describe A-* HEAD^
check_describe D-* HEAD^^
check_describe A-* HEAD^^2
check_describe B HEAD^^2^
+check_describe D-* HEAD^^^
check_describe c-* --tags HEAD
check_describe c-* --tags HEAD^
check_describe e-* --tags HEAD^^
check_describe c-* --tags HEAD^^2
check_describe B --tags HEAD^^2^
+check_describe e --tags HEAD^^^
+
+check_describe heads/master --all HEAD
+check_describe tags/c-* --all HEAD^
+check_describe tags/e --all HEAD^^^
check_describe B-0-* --long HEAD^^2^
check_describe A-3-* --long HEAD^^2