|
diff --git a/ui-tree.c b/ui-tree.c index 84930cb..c4d75ab 100644 --- a/ ui-tree.c+++ b/ ui-tree.c |
|
@@ -41,30 +41,30 @@ static int print_entry(const unsigned char *sha1, const char *base, |
41 | htmlf("<td class='filesize'>%li</td>", size); |
41 | htmlf("<td class='filesize'>%li</td>", size); |
42 | htmlf("<td class='filemode'>%06o</td>", mode); |
42 | htmlf("<td class='filemode'>%06o</td>", mode); |
43 | html("</tr>\n"); |
43 | html("</tr>\n"); |
44 | free(name); |
44 | free(name); |
45 | return 0; |
45 | return 0; |
46 | } |
46 | } |
47 | |
47 | |
48 | void cgit_print_tree(const char *hex) |
48 | void cgit_print_tree(const char *hex) |
49 | { |
49 | { |
50 | struct tree *tree; |
50 | struct tree *tree; |
51 | unsigned char sha1[20]; |
51 | unsigned char sha1[20]; |
52 | |
52 | |
53 | if (get_sha1_hex(hex, sha1)) { |
53 | if (get_sha1_hex(hex, sha1)) { |
54 | cgit_print_error(fmt("Invalid object id: %s", hex)); |
54 | cgit_print_error(fmt("Invalid object id: %s", hex)); |
55 | return; |
55 | return; |
56 | } |
56 | } |
57 | tree = parse_tree_indirect(sha1); |
57 | tree = parse_tree_indirect(sha1); |
58 | if (!tree) { |
58 | if (!tree) { |
59 | cgit_print_error(fmt("Not a tree object: %s", hex)); |
59 | cgit_print_error(fmt("Not a tree object: %s", hex)); |
60 | return; |
60 | return; |
61 | } |
61 | } |
62 | |
62 | |
63 | html("<h2>Tree content</h2>\n"); |
63 | html("<h2>Tree content</h2>\n"); |
64 | html("<table class='list'>\n"); |
64 | html("<table class='list'>\n"); |
65 | html("<tr><th>Name</th>"); |
65 | html("<tr><th class='left'>Name</th>"); |
66 | html("<th class='filesize'>Size</th>"); |
66 | html("<th class='right'>Size</th>"); |
67 | html("<th class='filemode'>Mode</th></tr>\n"); |
67 | html("<th class='right'>Mode</th></tr>\n"); |
68 | read_tree_recursive(tree, "", 0, 1, NULL, print_entry); |
68 | read_tree_recursive(tree, "", 0, 1, NULL, print_entry); |
69 | html("</table>\n"); |
69 | html("</table>\n"); |
70 | } |
70 | } |
|