X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=describe.c;h=ab192f83ae27c5e0bf3f2a5f61684d0dc66deb32;hb=151602df00b8e5c5b4a8193f59a94b85f9b5aebc;hp=2b9301fc1205795e30dfd7a7493cb03cdebdb437;hpb=500a99935dc157a6625b4decae0b97e896061c2c;p=git.git diff --git a/describe.c b/describe.c index 2b9301fc1..ab192f83a 100644 --- a/describe.c +++ b/describe.c @@ -42,7 +42,7 @@ static void add_to_known_names(const char *path, struct commit_name *name = xmalloc(sizeof(struct commit_name) + len); name->commit = commit; - name->prio = prio; + name->prio = prio; memcpy(name->path, path, len); idx = names; if (idx >= allocs) { @@ -154,14 +154,16 @@ int main(int argc, char **argv) tags = 1; else if (!strncmp(arg, "--abbrev=", 9)) { abbrev = strtoul(arg + 9, NULL, 10); - if (abbrev < MINIMUM_ABBREV || 40 <= abbrev) + if (abbrev < MINIMUM_ABBREV || 40 < abbrev) abbrev = DEFAULT_ABBREV; } else usage(describe_usage); } - if (i == argc) + setup_git_directory(); + + if (argc <= i) describe("HEAD", 1); else while (i < argc) {