@matheusbsbs / matheus-bagliano / commits / 024ab976ff
Fork 0

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>

Junio C Hamano committed Oct 23, 2009 at 11:42 UTC 024ab976fffdc1d78b6d0b15e261b52f3a5d594b
2 files changed +3 -1
builtin-describe.c
+1 -1
@@ -197,7 +197,7 @@ static void describe(const char *arg, int last_one)
197 for_each_ref(get_name, NULL);
198 }
199
200 - if (!found_names)
200 + if (!found_names && !always)
201 die("cannot describe '%s'", sha1_to_hex(sha1));
202
203 n = cmit->util;
t/t6120-describe.sh
+2
@@ -34,6 +34,8 @@ test_expect_success setup '
34 echo one >file && git add file && git commit -m initial &&
35 one=$(git rev-parse HEAD) &&
36
37 + git describe --always HEAD &&
38 +
39 test_tick &&
40 echo two >file && git add file && git commit -m second &&
41 two=$(git rev-parse HEAD) &&