diff options
author | John Keeping <john@keeping.me.uk> | 2017-02-19 12:02:37 +0000 |
---|---|---|
committer | Lukas Fleischer <lfleischer@lfos.de> | 2017-08-10 15:15:57 +0200 |
commit | 7d9b5590f4ffbc5d8a6fe30e3e9715ad4b5ca7bd (patch) | |
tree | 9a97912cb9d0e481a93bbf504a7ee966bfdf0fac | |
parent | c0d2423f07099366815856500faec3a69db1701a (diff) | |
download | cgit-7d9b5590f4ffbc5d8a6fe30e3e9715ad4b5ca7bd.tar.gz cgit-7d9b5590f4ffbc5d8a6fe30e3e9715ad4b5ca7bd.tar.bz2 cgit-7d9b5590f4ffbc5d8a6fe30e3e9715ad4b5ca7bd.zip |
cgit: don't set vpath unless repo is set
After the previous two patches, this can be classified as a tidy up
rather than a bug fix, but I think it makes sense to group all of the
tests together before setting up the environment for the command to
execute.
Signed-off-by: John Keeping <john@keeping.me.uk>
-rw-r--r-- | cgit.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -726,18 +726,18 @@ static void process_request(void) return; } - /* If cmd->want_vpath is set, assume ctx.qry.path contains a "virtual" - * in-project path limit to be made available at ctx.qry.vpath. - * Otherwise, no path limit is in effect (ctx.qry.vpath = NULL). - */ - ctx.qry.vpath = cmd->want_vpath ? ctx.qry.path : NULL; - if (cmd->want_repo && !ctx.repo) { cgit_print_error_page(400, "Bad request", "No repository selected"); return; } + /* If cmd->want_vpath is set, assume ctx.qry.path contains a "virtual" + * in-project path limit to be made available at ctx.qry.vpath. + * Otherwise, no path limit is in effect (ctx.qry.vpath = NULL). + */ + ctx.qry.vpath = cmd->want_vpath ? ctx.qry.path : NULL; + if (ctx.repo && prepare_repo_cmd()) return; |