X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=builtin-describe.c;h=df67a733ae5c91b0b4278c31c12a7432c0ec601e;hb=1d7d6ad539fabd49421d8ef7b27c0f287430bc7d;hp=63c6a19da5b38bc7c00c624c080ba0afbb10ff8a;hpb=86079872238041fa0e2aa6b8a94f7881f88e4316;p=git.git diff --git a/builtin-describe.c b/builtin-describe.c index 63c6a19da..df67a733a 100644 --- a/builtin-describe.c +++ b/builtin-describe.c @@ -20,6 +20,7 @@ static int tags; /* Allow lightweight tags */ static int longformat; static int abbrev = DEFAULT_ABBREV; static int max_candidates = 10; +static int found_names; static const char *pattern; static int always; @@ -49,6 +50,7 @@ static void add_to_known_names(const char *path, memcpy(e->path, path, len); commit->util = e; } + found_names = 1; } static int get_name(const char *path, const unsigned char *sha1, int flag, void *cb_data) @@ -195,6 +197,9 @@ static void describe(const char *arg, int last_one) for_each_ref(get_name, NULL); } + if (!found_names) + die("cannot describe '%s'", sha1_to_hex(sha1)); + n = cmit->util; if (n) { /* @@ -322,7 +327,7 @@ int cmd_describe(int argc, const char **argv, const char *prefix) OPT_END(), }; - argc = parse_options(argc, argv, options, describe_usage, 0); + argc = parse_options(argc, argv, prefix, options, describe_usage, 0); if (max_candidates < 0) max_candidates = 0; else if (max_candidates > MAX_TAGS)