diff options
| -rw-r--r-- | ui-tree.c | 15 |
1 files changed, 2 insertions, 13 deletions
| @@ -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&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; |
