diff options
Diffstat (limited to 'builtin/name-rev.c')
-rw-r--r-- | builtin/name-rev.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/builtin/name-rev.c b/builtin/name-rev.c index 31f5c1c971..1b374583c2 100644 --- a/builtin/name-rev.c +++ b/builtin/name-rev.c @@ -172,7 +172,9 @@ static void show_name(const struct object *obj, } static char const * const name_rev_usage[] = { - "git name-rev [options] ( --all | --stdin | <commit>... )", + "git name-rev [options] <commit>...", + "git name-rev [options] --all", + "git name-rev [options] --stdin", NULL }; @@ -289,7 +291,7 @@ int cmd_name_rev(int argc, const char **argv, const char *prefix) max = get_max_object_index(); for (i = 0; i < max; i++) { struct object *obj = get_indexed_object(i); - if (!obj) + if (!obj || obj->type != OBJ_COMMIT) continue; show_name(obj, NULL, always, allow_undefined, data.name_only); |