|
diff --git a/ui-tree.c b/ui-tree.c index c138877..7cae85a 100644 --- a/ ui-tree.c+++ b/ ui-tree.c |
|
@@ -35,5 +35,5 @@ static void print_object(const unsigned char *sha1, char *path) |
35 | |
35 | |
36 | html(" blob: <a href='"); |
36 | html(" blob: <a href='"); |
37 | html_attr(cgit_pageurl(cgit_query_repo, "blob", fmt("id=%s", sha1_to_hex(sha1)))); |
37 | html_attr(cgit_pageurl(ctx.qry.repo, "blob", fmt("id=%s", sha1_to_hex(sha1)))); |
38 | htmlf("'>%s</a>",sha1_to_hex(sha1)); |
38 | htmlf("'>%s</a>",sha1_to_hex(sha1)); |
39 | |
39 | |
@@ -68,6 +68,6 @@ static int ls_item(const unsigned char *sha1, const char *base, int baselen, |
68 | |
68 | |
69 | name = xstrdup(pathname); |
69 | name = xstrdup(pathname); |
70 | fullpath = fmt("%s%s%s", cgit_query_path ? cgit_query_path : "", |
70 | fullpath = fmt("%s%s%s", ctx.qry.path ? ctx.qry.path : "", |
71 | cgit_query_path ? "/" : "", name); |
71 | ctx.qry.path ? "/" : "", name); |
72 | |
72 | |
73 | type = sha1_object_info(sha1, &size); |
73 | type = sha1_object_info(sha1, &size); |
@@ -91,8 +91,8 @@ static int ls_item(const unsigned char *sha1, const char *base, int baselen, |
91 | html("</a>"); |
91 | html("</a>"); |
92 | } else if (S_ISDIR(mode)) { |
92 | } else if (S_ISDIR(mode)) { |
93 | cgit_tree_link(name, NULL, "ls-dir", cgit_query_head, |
93 | cgit_tree_link(name, NULL, "ls-dir", ctx.qry.head, |
94 | curr_rev, fullpath); |
94 | curr_rev, fullpath); |
95 | } else { |
95 | } else { |
96 | cgit_tree_link(name, NULL, "ls-blob", cgit_query_head, |
96 | cgit_tree_link(name, NULL, "ls-blob", ctx.qry.head, |
97 | curr_rev, fullpath); |
97 | curr_rev, fullpath); |
98 | } |
98 | } |
@@ -100,5 +100,5 @@ static int ls_item(const unsigned char *sha1, const char *base, int baselen, |
100 | |
100 | |
101 | html("<td>"); |
101 | html("<td>"); |
102 | cgit_log_link("log", NULL, "button", cgit_query_head, curr_rev, |
102 | cgit_log_link("log", NULL, "button", ctx.qry.head, curr_rev, |
103 | fullpath, 0, NULL, NULL); |
103 | fullpath, 0, NULL, NULL); |
104 | html("</td></tr>\n"); |
104 | html("</td></tr>\n"); |
@@ -154,8 +154,8 @@ static int walk_tree(const unsigned char *sha1, const char *base, int baselen, |
154 | memcpy(buffer, base, baselen); |
154 | memcpy(buffer, base, baselen); |
155 | strcpy(buffer+baselen, pathname); |
155 | strcpy(buffer+baselen, pathname); |
156 | url = cgit_pageurl(cgit_query_repo, "tree", |
156 | url = cgit_pageurl(ctx.qry.repo, "tree", |
157 | fmt("h=%s&path=%s", curr_rev, buffer)); |
157 | fmt("h=%s&path=%s", curr_rev, buffer)); |
158 | html("/"); |
158 | html("/"); |
159 | cgit_tree_link(xstrdup(pathname), NULL, NULL, cgit_query_head, |
159 | cgit_tree_link(xstrdup(pathname), NULL, NULL, ctx.qry.head, |
160 | curr_rev, buffer); |
160 | curr_rev, buffer); |
161 | |
161 | |
@@ -189,5 +189,5 @@ void cgit_print_tree(const char *rev, char *path) |
189 | |
189 | |
190 | if (!rev) |
190 | if (!rev) |
191 | rev = cgit_query_head; |
191 | rev = ctx.qry.head; |
192 | |
192 | |
193 | curr_rev = xstrdup(rev); |
193 | curr_rev = xstrdup(rev); |
@@ -203,5 +203,5 @@ void cgit_print_tree(const char *rev, char *path) |
203 | |
203 | |
204 | html("path: <a href='"); |
204 | html("path: <a href='"); |
205 | html_attr(cgit_pageurl(cgit_query_repo, "tree", fmt("h=%s", rev))); |
205 | html_attr(cgit_pageurl(ctx.qry.repo, "tree", fmt("h=%s", rev))); |
206 | html("'>root</a>"); |
206 | html("'>root</a>"); |
207 | |
207 | |
|