- match_path = path;
- read_tree_recursive(commit->tree, "", 0, 0, paths, walk_tree, NULL);
- ls_tail();
+ read_tree_recursive(commit->tree, "", 0, 0, &paths, walk_tree, &walk_tree_ctx);
+ if (walk_tree_ctx.state == 1)
+ ls_tail();
+ else if (walk_tree_ctx.state == 2)
+ cgit_print_layout_end();
+ else
+ cgit_print_error_page(404, "Not found", "Path not found");
+
+cleanup:
+ free(walk_tree_ctx.curr_rev);