Skip to content

Commit 024ab97

Browse files
committed
Do not fail "describe --always" in a tag-less repository
This fixes a regression introduce by d68dc34 (git-describe: Die early if there are no possible descriptions, 2009-08-06). Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 975457f commit 024ab97

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

builtin-describe.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ static void describe(const char *arg, int last_one)
197197
for_each_ref(get_name, NULL);
198198
}
199199

200-
if (!found_names)
200+
if (!found_names && !always)
201201
die("cannot describe '%s'", sha1_to_hex(sha1));
202202

203203
n = cmit->util;

t/t6120-describe.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ test_expect_success setup '
3434
echo one >file && git add file && git commit -m initial &&
3535
one=$(git rev-parse HEAD) &&
3636
37+
git describe --always HEAD &&
38+
3739
test_tick &&
3840
echo two >file && git add file && git commit -m second &&
3941
two=$(git rev-parse HEAD) &&

0 commit comments

Comments
 (0)