Diff options
-rw-r--r--source/ui-plain.c9
1 file changed, 5 insertions, 4 deletions
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;