This is a PoC for grepping the blobs in the current tree.
Showing the changes to cmd.c (1 of 5 files). Show all
Unified · Split
| @@ -127,7 +127,10 @@ static void tag_fn(struct cgit_context *ctx) · 126 unmodified lines | ||
| 127 | 127 | |
| 128 | 128 | static void tree_fn(struct cgit_context *ctx) |
| 129 | 129 | { |
| 130 | − cgit_print_tree(ctx->qry.sha1, ctx->qry.path); | |
| 130 | + if (ctx->qry.grep) | |
| 131 | + cgit_grep(ctx->qry.sha1, ctx->qry.path, ctx->qry.grep); | |
| 132 | + else | |
| 133 | + cgit_print_tree(ctx->qry.sha1, ctx->qry.path); | |
| 131 | 134 | } |
| 132 | 135 | |
| 133 | 136 | #define def_cmd(name, want_repo, want_layout, want_vpath, is_clone) \ |