aboutsummaryrefslogtreecommitdiffstats
path: root/ui-tree.c
diff options
context:
space:
mode:
authorLars Hjemli2010-06-22 16:15:48 +0200
committerLars Hjemli2010-06-22 16:15:48 +0200
commit37a24e4e39737edaa5cdde501346a65eeb280e63 (patch)
treeff23eb0d57edf108edd1aa3e64a8d6cf70062954 /ui-tree.c
parent47187b33be1c3de43fbed6f350ab05bc978aacd0 (diff)
parenta2cbd3c30b64a26b52b2003ba6569f3c083f4092 (diff)
downloadcgit-37a24e4e39737edaa5cdde501346a65eeb280e63.tar.gz
cgit-37a24e4e39737edaa5cdde501346a65eeb280e63.tar.bz2
cgit-37a24e4e39737edaa5cdde501346a65eeb280e63.zip
Merge branch 'jh/path-limit'
Conflicts: cgit.h ui-commit.c
Diffstat (limited to 'ui-tree.c')
-rw-r--r--ui-tree.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/ui-tree.c b/ui-tree.c
index 0ee38f2..75ec9cb 100644
--- a/ui-tree.c
+++ b/ui-tree.c
@@ -102,10 +102,10 @@ static void print_object(const unsigned char *sha1, char *path, const char *base
102 return; 102 return;
103 } 103 }
104 104
105 html(" ("); 105 htmlf("blob: %s (", sha1_to_hex(sha1));
106 cgit_plain_link("plain", NULL, NULL, ctx.qry.head, 106 cgit_plain_link("plain", NULL, NULL, ctx.qry.head,
107 curr_rev, path); 107 curr_rev, path);
108 htmlf(")<br/>blob: %s\n", sha1_to_hex(sha1)); 108 html(")\n");
109 109
110 if (ctx.cfg.max_blob_size && size / 1024 > ctx.cfg.max_blob_size) { 110 if (ctx.cfg.max_blob_size && size / 1024 > ctx.cfg.max_blob_size) {
111 htmlf("<div class='error'>blob size (%dKB) exceeds display size limit (%dKB).</div>", 111 htmlf("<div class='error'>blob size (%dKB) exceeds display size limit (%dKB).</div>",
@@ -225,17 +225,10 @@ static int walk_tree(const unsigned char *sha1, const char *base, int baselen,
225{ 225{
226 static int state; 226 static int state;
227 static char buffer[PATH_MAX]; 227 static char buffer[PATH_MAX];
228 char *url;
229 228
230 if (state == 0) { 229 if (state == 0) {
231 memcpy(buffer, base, baselen); 230 memcpy(buffer, base, baselen);
232 strcpy(buffer+baselen, pathname); 231 strcpy(buffer+baselen, pathname);
233 url = cgit_pageurl(ctx.qry.repo, "tree",
234 fmt("h=%s&amp;path=%s", curr_rev, buffer));
235 html("/");
236 cgit_tree_link(xstrdup(pathname), NULL, NULL, ctx.qry.head,
237 curr_rev, buffer);
238
239 if (strcmp(match_path, buffer)) 232 if (strcmp(match_path, buffer))
240 return READ_TREE_RECURSIVE; 233 return READ_TREE_RECURSIVE;
241 234
@@ -278,10 +271,6 @@ void cgit_print_tree(const char *rev, char *path)
278 return; 271 return;
279 } 272 }
280 273
281 html("path: <a href='");
282 html_attr(cgit_pageurl(ctx.qry.repo, "tree", fmt("h=%s", rev)));
283 html("'>root</a>");
284
285 if (path == NULL) { 274 if (path == NULL) {
286 ls_tree(commit->tree->object.sha1, NULL); 275 ls_tree(commit->tree->object.sha1, NULL);
287 return; 276 return;