Skip to content

Commit e8b14d7

Browse files
committed
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 <[email protected]>
1 parent e923eae commit e8b14d7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

builtin-name-rev.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ int cmd_name_rev(int argc, const char **argv, const char *prefix)
289289
max = get_max_object_index();
290290
for (i = 0; i < max; i++) {
291291
struct object *obj = get_indexed_object(i);
292-
if (!obj)
292+
if (!obj || obj->type != OBJ_COMMIT)
293293
continue;
294294
show_name(obj, NULL,
295295
always, allow_undefined, data.name_only);

0 commit comments

Comments
 (0)