diff options
| author | Patrick | 2025-12-23 23:35:54 +0100 |
|---|---|---|
| committer | Patrick | 2025-12-23 23:35:54 +0100 |
| commit | 1f820ce8f0c8ce6df5bdc072775ea631ca403960 (patch) | |
| tree | 39109d58b12ae2da5e54d9fb62530f85ee99d65b | |
| parent | 7dfc2b975fd4a735073536914f5a49b8d80a1104 (diff) | |
| download | ps-cgit-1f820ce8f0c8ce6df5bdc072775ea631ca403960.tar.gz ps-cgit-1f820ce8f0c8ce6df5bdc072775ea631ca403960.zip | |
redirect links without command (/git/<repo>/a/b.c) to /git/<repo>/tree/a/b.c
| -rw-r--r-- | cmd.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -204,5 +204,10 @@ struct cgit_cmd *cgit_get_cmd(void) for (i = 0; i < sizeof(cmds)/sizeof(*cmds); i++) if (!strcmp(ctx.qry.page, cmds[i].name)) return &cmds[i]; + + char *redirect = fmtalloc("/git/%s/tree/%s%s%s", ctx.qry.repo, ctx.qry.page, ctx.qry.path ? "/" : "", ctx.qry.path ? ctx.qry.path : ""); + cgit_redirect(redirect, false); + free(redirect); + return NULL; } |
