aboutsummaryrefslogtreecommitdiffstats
path: root/cmd.c
diff options
context:
space:
mode:
authorLars Hjemli <hjemli@gmail.com>2011-06-22 08:49:57 +0000
committerJason A. Donenfeld <Jason@zx2c4.com>2012-10-16 23:57:00 +0200
commitc028b604ef666d64a8aa9ebdfcf69675cd5d13fb (patch)
tree9c69df9b766d56d3c91c7c88c5ceb8ba40cb9dc1 /cmd.c
parentui-repolist: Rename section-sort to repository-sort. (diff)
downloadcgit-c028b604ef666d64a8aa9ebdfcf69675cd5d13fb.tar.xz
cgit-c028b604ef666d64a8aa9ebdfcf69675cd5d13fb.zip
Grep the source, Lukelh/grep
This is a PoC for grepping the blobs in the current tree. Signed-off-by: Lars Hjemli <larsh@hjemli.net>
Diffstat (limited to 'cmd.c')
-rw-r--r--cmd.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/cmd.c b/cmd.c
index 5a3d157..9a040a2 100644
--- a/cmd.c
+++ b/cmd.c
@@ -127,7 +127,10 @@ static void tag_fn(struct cgit_context *ctx)
static void tree_fn(struct cgit_context *ctx)
{
- cgit_print_tree(ctx->qry.sha1, ctx->qry.path);
+ if (ctx->qry.grep)
+ cgit_grep(ctx->qry.sha1, ctx->qry.path, ctx->qry.grep);
+ else
+ cgit_print_tree(ctx->qry.sha1, ctx->qry.path);
}
#define def_cmd(name, want_repo, want_layout, want_vpath, is_clone) \