diff options
-rw-r--r-- | builtin/describe.c | 7 | ||||
-rwxr-xr-x | t/t6120-describe.sh | 6 |
2 files changed, 10 insertions, 3 deletions
diff --git a/builtin/describe.c b/builtin/describe.c index 29075dbd0f..2004a1a86e 100644 --- a/builtin/describe.c +++ b/builtin/describe.c @@ -271,10 +271,13 @@ static void display_name(struct commit_name *n) n->name_checked = 1; } - if (n->tag) + if (n->tag) { + if (all) + printf("tags/"); printf("%s", n->tag->tag); - else + } else { printf("%s", n->path); + } } static void show_suffix(int depth, const struct object_id *oid) diff --git a/t/t6120-describe.sh b/t/t6120-describe.sh index 1c0e8659d9..15612b3bbe 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 ' @@ -340,4 +340,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 |