about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorJohan Herland2010-06-10 01:09:27 +0200
committerLars Hjemli2010-06-19 10:40:22 +0200
commitc8e3295469bd3b8e38a9ea4478d517d3861e6c93 (patch)
tree0dc6078a7a2a9a5706b9ed11c4083682ccb0ffca
parentstruct cgit_cmd: Differentiate between various usages of ctx.qry.path (diff)
downloadcgit-c8e3295469bd3b8e38a9ea4478d517d3861e6c93.tar.gz
cgit-c8e3295469bd3b8e38a9ea4478d517d3861e6c93.zip
ui-shared: Replace ctx.qry.path with ctx.qry.vpath
In all cases where ui-shared uses ctx.qry.path, it is done so in the context
of a in-project path, and not in the context in which the 'refs' page or the
'clone'-related functionality uses ctx.qry.path. Make this explicit by using
ctx.qry.vpath instead.

This path introduces no fundamental difference in functionality except for
fixing some minor bugs, for example the Atom feed reference from a
"$repo/refs/heads/" page.

Note that the usage of ctx.qry.path in the other ui-<page>.c files is ok,
since that code presumably is only executed in the context of its own <page>,
so the correct interpretation of ctx.qry.path is never in question.

Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
-rw-r--r--ui-shared.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/ui-shared.c b/ui-shared.c index 137e469..3d5030b 100644 --- a/ui-shared.c +++ b/ui-shared.c
@@ -534,7 +534,7 @@ void cgit_print_docstart(struct cgit_context *ctx)
534 html("<link rel='alternate' title='Atom feed' href='"); 534 html("<link rel='alternate' title='Atom feed' href='");
535 html(cgit_httpscheme()); 535 html(cgit_httpscheme());
536 html_attr(cgit_hosturl()); 536 html_attr(cgit_hosturl());
537 html_attr(cgit_fileurl(ctx->repo->url, "atom", ctx->qry.path, 537 html_attr(cgit_fileurl(ctx->repo->url, "atom", ctx->qry.vpath,
538 fmt("h=%s", ctx->qry.head))); 538 fmt("h=%s", ctx->qry.head)));
539 html("' type='application/atom+xml'/>\n"); 539 html("' type='application/atom+xml'/>\n");
540 } 540 }
@@ -621,8 +621,8 @@ void cgit_add_hidden_formfields(int incl_head, int incl_search,
621 621
622 if (!ctx.cfg.virtual_root) { 622 if (!ctx.cfg.virtual_root) {
623 url = fmt("%s/%s", ctx.qry.repo, page); 623 url = fmt("%s/%s", ctx.qry.repo, page);
624 if (ctx.qry.path) 624 if (ctx.qry.vpath)
625 url = fmt("%s/%s", url, ctx.qry.path); 625 url = fmt("%s/%s", url, ctx.qry.vpath);
626 html_hidden("url", url); 626 html_hidden("url", url);
627 } 627 }
628 628
@@ -728,7 +728,7 @@ void cgit_print_pageheader(struct cgit_context *ctx)
728 html("<form class='right' method='get' action='"); 728 html("<form class='right' method='get' action='");
729 if (ctx->cfg.virtual_root) 729 if (ctx->cfg.virtual_root)
730 html_url_path(cgit_fileurl(ctx->qry.repo, "log", 730 html_url_path(cgit_fileurl(ctx->qry.repo, "log",
731 ctx->qry.path, NULL)); 731 ctx->qry.vpath, NULL));
732 html("'>\n"); 732 html("'>\n");
733 cgit_add_hidden_formfields(1, 0, "log"); 733 cgit_add_hidden_formfields(1, 0, "log");
734 html("<select name='qt'>\n"); 734 html("<select name='qt'>\n");