From d946c8cf11385f5766e827ae71b3fc798750a335 Mon Sep 17 00:00:00 2001 From: justanothercatgirl Date: Wed, 2 Apr 2025 21:00:51 +0200 Subject: Added default_index config parameter. Note: currently breaks repos that contain no readme --- cmd.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'cmd.c') diff --git a/cmd.c b/cmd.c index 0eb75b1..dd1acd1 100644 --- a/cmd.c +++ b/cmd.c @@ -193,14 +193,13 @@ struct cgit_cmd *cgit_get_cmd(void) def_cmd(tree, 1, 1, 0), }; int i; - if (ctx.qry.page == NULL) { if (ctx.repo) - ctx.qry.page = "summary"; + ctx.qry.page = ctx.cfg.default_index; else ctx.qry.page = "repolist"; } - + for (i = 0; i < sizeof(cmds)/sizeof(*cmds); i++) if (!strcmp(ctx.qry.page, cmds[i].name)) return &cmds[i]; -- cgit v1.2.3-70-g09d2