name-rev --all: do not even attempt to describe non-commit object

This even dates back to the very beginning of "git name-rev"; it does not make much sense to dump all objects in the repository and label non-commits as "undefined". Signed-off-by: Junio C Hamano <gitster@pobox.com>

Junio C Hamano committed Nov 15, 2011 at 15:51 UTC e8b14d7e3fa5194fbc776cdd253b0b5403b2226d
1 file changed +1 -1
builtin-name-rev.c
+1 -1
@@ -289,7 +289,7 @@ int cmd_name_rev(int argc, const char **argv, const char *prefix)
289 max = get_max_object_index();
290 for (i = 0; i < max; i++) {
291 struct object *obj = get_indexed_object(i);
292 - if (!obj)
292 + if (!obj || obj->type != OBJ_COMMIT)
293 continue;
294 show_name(obj, NULL,
295 always, allow_undefined, data.name_only);