summaryrefslogtreecommitdiffabout
path: root/ui-shared.c
authorLars Hjemli <hjemli@gmail.com>2008-02-16 12:56:09 (UTC)
committer Lars Hjemli <hjemli@gmail.com>2008-02-16 12:56:09 (UTC)
commitd1f3bbe9d22029f45a77bb938c176ccc0c827d46 (patch) (side-by-side diff)
tree3f1741c012763cbc5485f31377abdd9241fbac6b /ui-shared.c
parentb228d4ff82a65fdcd4a7364759fe36a0bdda5978 (diff)
downloadcgit-d1f3bbe9d22029f45a77bb938c176ccc0c827d46.zip
cgit-d1f3bbe9d22029f45a77bb938c176ccc0c827d46.tar.gz
cgit-d1f3bbe9d22029f45a77bb938c176ccc0c827d46.tar.bz2
Move cgit_repo into cgit_context
This removes the global variable which is used to keep track of the currently selected repository, and adds a new variable in the cgit_context structure. Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Diffstat (limited to 'ui-shared.c') (more/less context) (ignore whitespace changes)
-rw-r--r--ui-shared.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/ui-shared.c b/ui-shared.c
index b96237d..b9f487a 100644
--- a/ui-shared.c
+++ b/ui-shared.c
@@ -143,4 +143,4 @@ static char *repolink(char *title, char *class, char *page, char *head,
html("/");
- html_attr(cgit_repo->url);
- if (cgit_repo->url[strlen(cgit_repo->url) - 1] != '/')
+ html_attr(ctx.repo->url);
+ if (ctx.repo->url[strlen(ctx.repo->url) - 1] != '/')
html("/");
@@ -155,4 +155,4 @@ static char *repolink(char *title, char *class, char *page, char *head,
html("?url=");
- html_attr(cgit_repo->url);
- if (cgit_repo->url[strlen(cgit_repo->url) - 1] != '/')
+ html_attr(ctx.repo->url);
+ if (ctx.repo->url[strlen(ctx.repo->url) - 1] != '/')
html("/");
@@ -166,3 +166,3 @@ static char *repolink(char *title, char *class, char *page, char *head,
}
- if (head && strcmp(head, cgit_repo->defbranch)) {
+ if (head && strcmp(head, ctx.repo->defbranch)) {
html(delim);
@@ -448,3 +448,3 @@ void add_hidden_formfields(int incl_head, int incl_search, char *page)
- if (incl_head && strcmp(ctx.qry.head, cgit_repo->defbranch))
+ if (incl_head && strcmp(ctx.qry.head, ctx.repo->defbranch))
html_hidden("h", ctx.qry.head);
@@ -480,8 +480,8 @@ void cgit_print_pageheader(char *title, int show_search)
html("<h1 class='first'>");
- html_txt(strrpart(cgit_repo->name, 20));
+ html_txt(strrpart(ctx.repo->name, 20));
html("</h1>\n");
- html_txt(cgit_repo->desc);
- if (cgit_repo->owner) {
+ html_txt(ctx.repo->desc);
+ if (ctx.repo->owner) {
html("<h1>owner</h1>\n");
- html_txt(cgit_repo->owner);
+ html_txt(ctx.repo->owner);
}
@@ -503,9 +503,9 @@ void cgit_print_pageheader(char *title, int show_search)
- if (cgit_repo->clone_url || ctx.cfg.clone_prefix) {
+ if (ctx.repo->clone_url || ctx.cfg.clone_prefix) {
html("<h1>clone</h1>\n");
- if (cgit_repo->clone_url)
- url = cgit_repo->clone_url;
+ if (ctx.repo->clone_url)
+ url = ctx.repo->clone_url;
else
url = fmt("%s%s", ctx.cfg.clone_prefix,
- cgit_repo->url);
+ ctx.repo->url);
html("<a class='menu' href='");