-rw-r--r-- | ui-tree.c | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -30,9 +30,14 @@ static int print_entry(const unsigned char *sha1, const char *base, html("<div class='ls-dir'><a href='"); html_attr(cgit_pageurl(cgit_query_repo, "tree", - fmt("id=%s", sha1_to_hex(sha1)))); + fmt("id=%s&path=%s%s/", + sha1_to_hex(sha1), + cgit_query_path ? cgit_query_path : "", + pathname))); } else { html("<div class='ls-blob'><a href='"); html_attr(cgit_pageurl(cgit_query_repo, "view", - fmt("id=%s", sha1_to_hex(sha1)))); + fmt("id=%s&path=%s%s", sha1_to_hex(sha1), + cgit_query_path ? cgit_query_path : "", + pathname))); } html("'>"); @@ -47,5 +52,5 @@ static int print_entry(const unsigned char *sha1, const char *base, } -void cgit_print_tree(const char *hex) +void cgit_print_tree(const char *hex, char *path) { struct tree *tree; @@ -63,4 +68,5 @@ void cgit_print_tree(const char *hex) html("<h2>Tree content</h2>\n"); + html_txt(path); html("<table class='list'>\n"); html("<tr>"); |