diff --git a/builtin-name-rev.c b/builtin-name-rev.c
index cde5de56fa43c1552722965343867b2baaebdaf4..85612c4dcb719b460623204046e35486e9d9fe97 100644 (file)
--- a/builtin-name-rev.c
+++ b/builtin-name-rev.c
}
static char const * const name_rev_usage[] = {
- "git-name-rev [options] ( --all | --stdin | <commit>... )",
+ "git name-rev [options] ( --all | --stdin | <commit>... )",
NULL
};
int i, max;
max = get_max_object_index();
- for (i = 0; i < max; i++)
- show_name(get_indexed_object(i), NULL,
+ for (i = 0; i < max; i++) {
+ struct object *obj = get_indexed_object(i);
+ if (!obj)
+ continue;
+ show_name(obj, NULL,
always, allow_undefined, data.name_only);
+ }
} else {
int i;
for (i = 0; i < revs.nr; i++)