aboutsummaryrefslogtreecommitdiff
path: root/cgit.c
diff options
context:
space:
mode:
Diffstat (limited to 'cgit.c')
-rw-r--r--cgit.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/cgit.c b/cgit.c
index 38bc136..ab25b6a 100644
--- a/cgit.c
+++ b/cgit.c
@@ -258,6 +258,8 @@ static void querystring_cb(const char *name, const char *value)
ctx.qry.ssdiff = atoi(value);
} else if (!strcmp(name, "all")) {
ctx.qry.show_all = atoi(value);
+ } else if (!strcmp(name, "context")) {
+ ctx.qry.context = atoi(value);
}
}
@@ -433,6 +435,12 @@ static void process_request(void *cbdata)
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_http_headers(ctx);
cgit_print_docstart(ctx);