X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=name-rev.c;h=083d067e17f6bfbdbd936b0fbe3683ac4f1f7b5b;hb=e40e0135f24a140935c218af43d0bf8b7b07067b;hp=3a5ac35d163bae5431c9cad8c9e31918c2734241;hpb=c3e160886214c3e7d1e939918900c56e0d1aca56;p=git.git diff --git a/name-rev.c b/name-rev.c index 3a5ac35d1..083d067e1 100644 --- a/name-rev.c +++ b/name-rev.c @@ -5,7 +5,7 @@ #include "refs.h" static const char name_rev_usage[] = - "git-name-rev [--tags] ( --all | --stdin | commitish [commitish...] )\n"; + "git-name-rev [--tags] ( --all | --stdin | committish [committish...] )\n"; typedef struct rev_name { const char *tip_name; @@ -234,12 +234,15 @@ int main(int argc, char **argv) fwrite(p_start, p - p_start, 1, stdout); } } else if (all) { - int i; + int i, max; - for (i = 0; i < obj_allocs; i++) - if (objs[i]) - printf("%s %s\n", sha1_to_hex(objs[i]->sha1), - get_rev_name(objs[i])); + max = get_max_object_index(); + for (i = 0; i < max; i++) { + struct object * obj = get_indexed_object(i); + if (!obj) + continue; + printf("%s %s\n", sha1_to_hex(obj->sha1), get_rev_name(obj)); + } } else { int i; for (i = 0; i < revs.nr; i++)