Junio C Hamano  committed e8b14d7

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 <>

  • Participants
  • Parent commits e923eae
  • Branches master

Comments (0)

Files changed (1)

File builtin-name-rev.c

 		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)
 			show_name(obj, NULL,
 				  always, allow_undefined, data.name_only);