Skip to content

Commit 350296c

Browse files
steadmongitster
authored andcommitted
ls-tree: -l should not imply recursive listing
In 9c4d58f (ls-tree: split up "fast path" callbacks, 2022-03-23), a refactoring of the various read_tree_at() callbacks caused us to unconditionally recurse into directories if `-l` (long format) was passed on the command line, regardless of whether or not we also pass the `-r` (recursive) flag. Fix this by making show_tree_long() return the value of `recurse`, rather than always returning 1. This value is interpreted by read_tree_at() to be a signal on whether or not to recurse. Signed-off-by: Josh Steadmon <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 9c4d58f commit 350296c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

builtin/ls-tree.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ static int show_tree_long(const struct object_id *oid, struct strbuf *base,
255255
printf("%06o %s %s %7s\t", data.mode, type_name(data.type),
256256
find_unique_abbrev(data.oid, abbrev), size_text);
257257
show_tree_common_default_long(base, pathname, data.base->len);
258-
return 1;
258+
return recurse;
259259
}
260260

261261
static int show_tree_name_only(const struct object_id *oid, struct strbuf *base,

0 commit comments

Comments
 (0)