]> gitweb.ps.run Git - ps-cgit/blobdiff - cgit.c
ui-patch: Apply path limit to generated patch
[ps-cgit] / cgit.c
diff --git a/cgit.c b/cgit.c
index 9305d0a873a191e730d622d14067a2eee56003a6..2c3ad73e064b556a23629194b9ca0a0a696186ee 100644 (file)
--- a/cgit.c
+++ b/cgit.c
@@ -424,6 +424,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);