Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.zx2c4.com/cgit.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/cgit.c
diff options
context:
space:
mode:
authorJohn Keeping <john@keeping.me.uk>2017-02-19 15:02:37 +0300
committerJason A. Donenfeld <Jason@zx2c4.com>2017-08-10 17:05:07 +0300
commit113f4b85886bc5eb6b319fd048623b8d43b7bce0 (patch)
treee82c10650e3b0b2c33d3ec955a3e44d853a5f431 /cgit.c
parentc699866699411346c5dba406457581013f85a873 (diff)
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>
Diffstat (limited to 'cgit.c')
-rw-r--r--cgit.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/cgit.c b/cgit.c
index 1075753..1dae4b8 100644
--- a/cgit.c
+++ b/cgit.c
@@ -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;