Skip to content

Commit 468dc22

Browse files
committed
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
2 parents af38dee + 1bba001 commit 468dc22

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

builtin/describe.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,10 +274,13 @@ static void append_name(struct commit_name *n, struct strbuf *dst)
274274
n->name_checked = 1;
275275
}
276276

277-
if (n->tag)
277+
if (n->tag) {
278+
if (all)
279+
strbuf_addstr(dst, "tags/");
278280
strbuf_addstr(dst, n->tag->tag);
279-
else
281+
} else {
280282
strbuf_addstr(dst, n->path);
283+
}
281284
}
282285

283286
static void append_suffix(int depth, const struct object_id *oid, struct strbuf *dst)

t/t6120-describe.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ test_expect_success 'describe --contains defaults to HEAD without commit-ish' '
122122
'
123123

124124
: >err.expect
125-
check_describe A --all A^0
125+
check_describe tags/A --all A^0
126126
test_expect_success 'no warning was displayed for A' '
127127
test_cmp err.expect err.actual
128128
'
@@ -374,4 +374,8 @@ test_expect_success ULIMIT_STACK_SIZE 'describe works in a deep repo' '
374374
test_cmp expect actual
375375
'
376376

377+
check_describe tags/A --all A
378+
check_describe tags/c --all c
379+
check_describe heads/branch_A --all --match='branch_*' branch_A
380+
377381
test_done

0 commit comments

Comments
 (0)