|
diff --git a/ui-tree.c b/ui-tree.c index f53ab64..a164767 100644 --- a/ ui-tree.c+++ b/ ui-tree.c |
|
@@ -259,27 +259,27 @@ void cgit_print_tree(const char *rev, char *path) |
259 | if (!rev) |
259 | if (!rev) |
260 | rev = ctx.qry.head; |
260 | rev = ctx.qry.head; |
261 | |
261 | |
262 | curr_rev = xstrdup(rev); |
262 | curr_rev = xstrdup(rev); |
263 | if (get_sha1(rev, sha1)) { |
263 | if (get_sha1(rev, sha1)) { |
264 | cgit_print_error(fmt("Invalid revision name: %s", rev)); |
264 | cgit_print_error(fmt("Invalid revision name: %s", rev)); |
265 | return; |
265 | return; |
266 | } |
266 | } |
267 | commit = lookup_commit_reference(sha1); |
267 | commit = lookup_commit_reference(sha1); |
268 | if (!commit || parse_commit(commit)) { |
268 | if (!commit || parse_commit(commit)) { |
269 | cgit_print_error(fmt("Invalid commit reference: %s", rev)); |
269 | cgit_print_error(fmt("Invalid commit reference: %s", rev)); |
270 | return; |
270 | return; |
271 | } |
271 | } |
272 | |
272 | |
273 | html("path: <a href='"); |
273 | html("path: <a href='"); |
274 | html_attr(cgit_pageurl(ctx.qry.repo, "tree", fmt("h=%s", rev))); |
274 | html_attr(cgit_pageurl(ctx.qry.repo, "tree", fmt("h=%s", rev))); |
275 | html("'>root</a>"); |
275 | html("'>root</a>"); |
276 | |
276 | |
277 | if (path == NULL) { |
277 | if (path == NULL) { |
278 | ls_tree(commit->tree->object.sha1, NULL); |
278 | ls_tree(commit->tree->object.sha1, NULL); |
279 | return; |
279 | return; |
280 | } |
280 | } |
281 | |
281 | |
282 | match_path = path; |
282 | match_path = path; |
283 | read_tree_recursive(commit->tree, NULL, 0, 0, paths, walk_tree, NULL); |
283 | read_tree_recursive(commit->tree, "", 0, 0, paths, walk_tree, NULL); |
284 | ls_tail(); |
284 | ls_tail(); |
285 | } |
285 | } |
|