author | Lars Hjemli <hjemli@gmail.com> | 2008-02-16 10:53:40 (UTC) |
---|---|---|
committer | Lars Hjemli <hjemli@gmail.com> | 2008-02-16 11:07:28 (UTC) |
commit | d14d77fe95c3b6224b40df9b101dded0deea913c (patch) (unidiff) | |
tree | 7e0d9c8f2c0f86b8946aea0bb823085c33b164b3 /ui-log.c | |
parent | e5ed227ef0da561e2bde8646ec816842392377ee (diff) | |
download | cgit-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>
-rw-r--r-- | ui-log.c | 20 |
1 files changed, 10 insertions, 10 deletions
@@ -36,9 +36,9 @@ void print_commit(struct commit *commit) | |||
36 | info = cgit_parse_commit(commit); | 36 | info = cgit_parse_commit(commit); |
37 | html("<tr><td>"); | 37 | html("<tr><td>"); |
38 | cgit_print_age(commit->date, TM_WEEK * 2, FMT_SHORTDATE); | 38 | cgit_print_age(commit->date, TM_WEEK * 2, FMT_SHORTDATE); |
39 | html("</td><td>"); | 39 | html("</td><td>"); |
40 | cgit_commit_link(info->subject, NULL, NULL, cgit_query_head, | 40 | cgit_commit_link(info->subject, NULL, NULL, ctx.qry.head, |
41 | sha1_to_hex(commit->object.sha1)); | 41 | sha1_to_hex(commit->object.sha1)); |
42 | if (cgit_repo->enable_log_filecount) { | 42 | if (cgit_repo->enable_log_filecount) { |
43 | files = 0; | 43 | files = 0; |
44 | add_lines = 0; | 44 | add_lines = 0; |
@@ -66,9 +66,9 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern | |||
66 | int argc = 2; | 66 | int argc = 2; |
67 | int i; | 67 | int i; |
68 | 68 | ||
69 | if (!tip) | 69 | if (!tip) |
70 | argv[1] = cgit_query_head; | 70 | argv[1] = ctx.qry.head; |
71 | 71 | ||
72 | if (grep && pattern && (!strcmp(grep, "grep") || | 72 | if (grep && pattern && (!strcmp(grep, "grep") || |
73 | !strcmp(grep, "author") || | 73 | !strcmp(grep, "author") || |
74 | !strcmp(grep, "committer"))) | 74 | !strcmp(grep, "committer"))) |
@@ -122,19 +122,19 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern | |||
122 | 122 | ||
123 | if (pager) { | 123 | if (pager) { |
124 | html("<div class='pager'>"); | 124 | html("<div class='pager'>"); |
125 | if (ofs > 0) { | 125 | if (ofs > 0) { |
126 | cgit_log_link("[prev]", NULL, NULL, cgit_query_head, | 126 | cgit_log_link("[prev]", NULL, NULL, ctx.qry.head, |
127 | cgit_query_sha1, cgit_query_path, | 127 | ctx.qry.sha1, ctx.qry.path, |
128 | ofs - cnt, cgit_query_grep, | 128 | ofs - cnt, ctx.qry.grep, |
129 | cgit_query_search); | 129 | ctx.qry.search); |
130 | html(" "); | 130 | html(" "); |
131 | } | 131 | } |
132 | if ((commit = get_revision(&rev)) != NULL) { | 132 | if ((commit = get_revision(&rev)) != NULL) { |
133 | cgit_log_link("[next]", NULL, NULL, cgit_query_head, | 133 | cgit_log_link("[next]", NULL, NULL, ctx.qry.head, |
134 | cgit_query_sha1, cgit_query_path, | 134 | ctx.qry.sha1, ctx.qry.path, |
135 | ofs + cnt, cgit_query_grep, | 135 | ofs + cnt, ctx.qry.grep, |
136 | cgit_query_search); | 136 | ctx.qry.search); |
137 | } | 137 | } |
138 | html("</div>"); | 138 | html("</div>"); |
139 | } | 139 | } |
140 | } | 140 | } |