summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-02-15 23:18:10 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-02-15 23:18:10 (GMT)
commit468dc22e0085db29994b4296ca0127f27a686fa0 (patch)
treebbc3dde066a79001dd1524745559f88e09a17995
parentaf38deeb472ae1921b7d367c4b406722b2dd9eef (diff)
parent1bba00130a1a0332ec0ad2f878a09ca9b2b18ee2 (diff)
downloadgit-468dc22e0085db29994b4296ca0127f27a686fa0.zip
git-468dc22e0085db29994b4296ca0127f27a686fa0.tar.gz
git-468dc22e0085db29994b4296ca0127f27a686fa0.tar.bz2
Merge branch 'dk/describe-all-output-fix' into maint
An old regression in "git describe --all $annotated_tag^0" has been fixed. * dk/describe-all-output-fix: describe: prepend "tags/" when describing tags with embedded name
-rw-r--r--builtin/describe.c7
-rwxr-xr-xt/t6120-describe.sh6
2 files changed, 10 insertions, 3 deletions
diff --git a/builtin/describe.c b/builtin/describe.c
index 3b0b204..6fe1c51 100644
--- a/builtin/describe.c
+++ b/builtin/describe.c
@@ -274,10 +274,13 @@ static void append_name(struct commit_name *n, struct strbuf *dst)
n->name_checked = 1;
}
- if (n->tag)
+ if (n->tag) {
+ if (all)
+ strbuf_addstr(dst, "tags/");
strbuf_addstr(dst, n->tag->tag);
- else
+ } else {
strbuf_addstr(dst, n->path);
+ }
}
static void append_suffix(int depth, const struct object_id *oid, struct strbuf *dst)
diff --git a/t/t6120-describe.sh b/t/t6120-describe.sh
index 3e3fb46..a5d9015 100755
--- a/t/t6120-describe.sh
+++ b/t/t6120-describe.sh
@@ -122,7 +122,7 @@ test_expect_success 'describe --contains defaults to HEAD without commit-ish' '
'
: >err.expect
-check_describe A --all A^0
+check_describe tags/A --all A^0
test_expect_success 'no warning was displayed for A' '
test_cmp err.expect err.actual
'
@@ -374,4 +374,8 @@ test_expect_success ULIMIT_STACK_SIZE 'describe works in a deep repo' '
test_cmp expect actual
'
+check_describe tags/A --all A
+check_describe tags/c --all c
+check_describe heads/branch_A --all --match='branch_*' branch_A
+
test_done