Skip to content

Commit 4a314e7

Browse files
committed
Merge branch 'jk/describe-perf' into seen
* jk/describe-perf: describe: drop early return for max_candidates == 0
2 parents 01b17e9 + 59d1808 commit 4a314e7

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

builtin/describe.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,8 +338,6 @@ static void describe_commit(struct object_id *oid, struct strbuf *dst)
338338
return;
339339
}
340340

341-
if (!max_candidates)
342-
die(_("no tag exactly matches '%s'"), oid_to_hex(&cmit->object.oid));
343341
if (debug)
344342
fprintf(stderr, _("No exact match on refs or tags, searching to describe\n"));
345343

t/t6120-describe.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -715,4 +715,10 @@ test_expect_success 'describe --broken --dirty with a file with changed stat' '
715715
)
716716
'
717717

718+
test_expect_success '--always with no refs falls back to commit hash' '
719+
git rev-parse HEAD >expect &&
720+
git describe --no-abbrev --always --match=no-such-tag >actual &&
721+
test_cmp expect actual
722+
'
723+
718724
test_done

0 commit comments

Comments
 (0)