summaryrefslogtreecommitdiffabout
path: root/ui-commit.c
authorLars Hjemli <hjemli@gmail.com>2008-02-16 10:53:40 (UTC)
committer Lars Hjemli <hjemli@gmail.com>2008-02-16 11:07:28 (UTC)
commitd14d77fe95c3b6224b40df9b101dded0deea913c (patch) (side-by-side diff)
tree7e0d9c8f2c0f86b8946aea0bb823085c33b164b3 /ui-commit.c
parente5ed227ef0da561e2bde8646ec816842392377ee (diff)
downloadcgit-d14d77fe95c3b6224b40df9b101dded0deea913c.zip
cgit-d14d77fe95c3b6224b40df9b101dded0deea913c.tar.gz
cgit-d14d77fe95c3b6224b40df9b101dded0deea913c.tar.bz2
Introduce struct cgit_context
This struct will hold all the cgit runtime information currently found in a multitude of global variables. The first cleanup removes all querystring-related variables. Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Diffstat (limited to 'ui-commit.c') (more/less context) (ignore whitespace changes)
-rw-r--r--ui-commit.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/ui-commit.c b/ui-commit.c
index bd55a33..3b0919b 100644
--- a/ui-commit.c
+++ b/ui-commit.c
@@ -76,5 +76,5 @@ void print_fileinfo(struct fileinfo *info)
}
htmlf("</td><td class='%s'>", class);
- cgit_diff_link(info->new_path, NULL, NULL, cgit_query_head, curr_rev,
+ cgit_diff_link(info->new_path, NULL, NULL, ctx.qry.head, curr_rev,
NULL, info->new_path);
if (info->status == DIFF_STATUS_COPIED || info->status == DIFF_STATUS_RENAMED)
@@ -144,5 +144,5 @@ void cgit_print_commit(char *hex)
if (!hex)
- hex = cgit_query_head;
+ hex = ctx.qry.head;
curr_rev = hex;
@@ -176,5 +176,5 @@ void cgit_print_commit(char *hex)
tmp = xstrdup(hex);
cgit_tree_link(sha1_to_hex(commit->tree->object.sha1), NULL, NULL,
- cgit_query_head, tmp, NULL);
+ ctx.qry.head, tmp, NULL);
html("</td></tr>\n");
for (p = commit->parents; p ; p = p->next) {
@@ -189,7 +189,7 @@ void cgit_print_commit(char *hex)
"<td colspan='2' class='sha1'>");
cgit_commit_link(sha1_to_hex(p->item->object.sha1), NULL, NULL,
- cgit_query_head, sha1_to_hex(p->item->object.sha1));
+ ctx.qry.head, sha1_to_hex(p->item->object.sha1));
html(" (");
- cgit_diff_link("diff", NULL, NULL, cgit_query_head, hex,
+ cgit_diff_link("diff", NULL, NULL, ctx.qry.head, hex,
sha1_to_hex(p->item->object.sha1), NULL);
html(")</td></tr>");
@@ -197,5 +197,5 @@ void cgit_print_commit(char *hex)
if (cgit_repo->snapshots) {
html("<tr><th>download</th><td colspan='2' class='sha1'>");
- cgit_print_snapshot_links(cgit_query_repo, cgit_query_head,
+ cgit_print_snapshot_links(ctx.qry.repo, ctx.qry.head,
hex, cgit_repo->snapshots);
html("</td></tr>");
@@ -219,5 +219,5 @@ void cgit_print_commit(char *hex)
htmlf("%d files changed, %d insertions, %d deletions (",
files, total_adds, total_rems);
- cgit_diff_link("show diff", NULL, NULL, cgit_query_head, hex,
+ cgit_diff_link("show diff", NULL, NULL, ctx.qry.head, hex,
NULL, NULL);
html(")</div>");