From 98f536cc94c5b6389b36bef9eb5b189c333c6cca Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sat, 31 Oct 2026 13:21:31 -0700 Subject: Test a plain page entry's level once --- source/ui-plain.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'source') diff --git a/source/ui-plain.c b/source/ui-plain.c index fc39af2..5bfc41e 100644 --- a/source/ui-plain.c +++ b/source/ui-plain.c @@ -164,11 +164,12 @@ static int walk_tree(const struct object_id *oid, struct strbuf *base, { struct walk_tree_context *walk = context; - // A tree can hold two entries of one name, and only the first answers: - // a second response would follow the first in the same body. - if (walk->response != RESPONSE_NONE && walk->dir_len >= 0 && base->len == (size_t)walk->dir_len) - return 0; if (walk->dir_len >= 0 && base->len == (size_t)walk->dir_len) { + // A tree can hold two entries of one name, and only the first + // answers: a second response would follow the first in the same + // body. + if (walk->response != RESPONSE_NONE) + return 0; if (S_ISREG(mode) || S_ISLNK(mode)) { print_object(oid, pathname); walk->response = RESPONSE_BLOB; -- cgit 2.11.1