summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: bcc9b74)
raw | patch | inline | side by side (parent: bcc9b74)
author | René Scharfe <rene.scharfe@lsrfire.ath.cx> | |
Sat, 17 Oct 2009 16:30:48 +0000 (18:30 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 19 Oct 2009 06:00:02 +0000 (23:00 -0700) |
Get rid of the static variable that was used to prevent loading all
the refnames multiple times by moving that code out of describe(),
simply making sure it is only run once that way.
Also change the error message that is shown in case no refnames are
found to not include a hash any more, as the error condition is not
specific to any particular revision.
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
the refnames multiple times by moving that code out of describe(),
simply making sure it is only run once that way.
Also change the error message that is shown in case no refnames are
found to not include a hash any more, as the error condition is not
specific to any particular revision.
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-describe.c | patch | blob | history |
diff --git a/builtin-describe.c b/builtin-describe.c
index df67a733ae5c91b0b4278c31c12a7432c0ec601e..2dcfd3dfebdaad8fe87b8d09fa00b058f519ac5a 100644 (file)
--- a/builtin-describe.c
+++ b/builtin-describe.c
unsigned char sha1[20];
struct commit *cmit, *gave_up_on = NULL;
struct commit_list *list;
- static int initialized = 0;
struct commit_name *n;
struct possible_tag all_matches[MAX_TAGS];
unsigned int match_cnt = 0, annotated_cnt = 0, cur_match;
if (!cmit)
die("%s is not a valid '%s' object", arg, commit_type);
- if (!initialized) {
- initialized = 1;
- for_each_ref(get_name, NULL);
- }
-
- if (!found_names)
- die("cannot describe '%s'", sha1_to_hex(sha1));
-
n = cmit->util;
if (n) {
/*
return cmd_name_rev(i + argc, args, prefix);
}
+ for_each_ref(get_name, NULL);
+ if (!found_names)
+ die("No names found, cannot describe anything.");
+
if (argc == 0) {
describe("HEAD", 1);
} else {