author | Lars Hjemli <hjemli@gmail.com> | 2010-06-22 14:15:48 (UTC) |
---|---|---|
committer | Lars Hjemli <hjemli@gmail.com> | 2010-06-22 14:15:48 (UTC) |
commit | 37a24e4e39737edaa5cdde501346a65eeb280e63 (patch) (unidiff) | |
tree | ff23eb0d57edf108edd1aa3e64a8d6cf70062954 /cgit.c | |
parent | 47187b33be1c3de43fbed6f350ab05bc978aacd0 (diff) | |
parent | a2cbd3c30b64a26b52b2003ba6569f3c083f4092 (diff) | |
download | cgit-37a24e4e39737edaa5cdde501346a65eeb280e63.zip cgit-37a24e4e39737edaa5cdde501346a65eeb280e63.tar.gz cgit-37a24e4e39737edaa5cdde501346a65eeb280e63.tar.bz2 |
Merge branch 'jh/path-limit'
Conflicts:
cgit.h
ui-commit.c
-rw-r--r-- | cgit.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -420,32 +420,38 @@ static int prepare_repo_cmd(struct cgit_context *ctx) | |||
420 | static void process_request(void *cbdata) | 420 | static void process_request(void *cbdata) |
421 | { | 421 | { |
422 | struct cgit_context *ctx = cbdata; | 422 | struct cgit_context *ctx = cbdata; |
423 | struct cgit_cmd *cmd; | 423 | struct cgit_cmd *cmd; |
424 | 424 | ||
425 | cmd = cgit_get_cmd(ctx); | 425 | cmd = cgit_get_cmd(ctx); |
426 | if (!cmd) { | 426 | if (!cmd) { |
427 | ctx->page.title = "cgit error"; | 427 | ctx->page.title = "cgit error"; |
428 | cgit_print_http_headers(ctx); | 428 | cgit_print_http_headers(ctx); |
429 | cgit_print_docstart(ctx); | 429 | cgit_print_docstart(ctx); |
430 | cgit_print_pageheader(ctx); | 430 | cgit_print_pageheader(ctx); |
431 | cgit_print_error("Invalid request"); | 431 | cgit_print_error("Invalid request"); |
432 | cgit_print_docend(); | 432 | cgit_print_docend(); |
433 | return; | 433 | return; |
434 | } | 434 | } |
435 | 435 | ||
436 | /* If cmd->want_vpath is set, assume ctx->qry.path contains a "virtual" | ||
437 | * in-project path limit to be made available at ctx->qry.vpath. | ||
438 | * Otherwise, no path limit is in effect (ctx->qry.vpath = NULL). | ||
439 | */ | ||
440 | ctx->qry.vpath = cmd->want_vpath ? ctx->qry.path : NULL; | ||
441 | |||
436 | if (cmd->want_repo && !ctx->repo) { | 442 | if (cmd->want_repo && !ctx->repo) { |
437 | cgit_print_http_headers(ctx); | 443 | cgit_print_http_headers(ctx); |
438 | cgit_print_docstart(ctx); | 444 | cgit_print_docstart(ctx); |
439 | cgit_print_pageheader(ctx); | 445 | cgit_print_pageheader(ctx); |
440 | cgit_print_error(fmt("No repository selected")); | 446 | cgit_print_error(fmt("No repository selected")); |
441 | cgit_print_docend(); | 447 | cgit_print_docend(); |
442 | return; | 448 | return; |
443 | } | 449 | } |
444 | 450 | ||
445 | if (ctx->repo && prepare_repo_cmd(ctx)) | 451 | if (ctx->repo && prepare_repo_cmd(ctx)) |
446 | return; | 452 | return; |
447 | 453 | ||
448 | if (cmd->want_layout) { | 454 | if (cmd->want_layout) { |
449 | cgit_print_http_headers(ctx); | 455 | cgit_print_http_headers(ctx); |
450 | cgit_print_docstart(ctx); | 456 | cgit_print_docstart(ctx); |
451 | cgit_print_pageheader(ctx); | 457 | cgit_print_pageheader(ctx); |