summaryrefslogtreecommitdiffabout
path: root/ui-tree.c
Side-by-side diff
Diffstat (limited to 'ui-tree.c') (more/less context) (show whitespace changes)
-rw-r--r--ui-tree.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/ui-tree.c b/ui-tree.c
index 54dcdbe..ed9f05e 100644
--- a/ui-tree.c
+++ b/ui-tree.c
@@ -31,3 +31,6 @@ static int print_entry(const unsigned char *sha1, const char *base,
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 {
@@ -35,3 +38,5 @@ static int print_entry(const unsigned char *sha1, const char *base,
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)));
}
@@ -48,3 +53,3 @@ 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)
{
@@ -64,2 +69,3 @@ void cgit_print_tree(const char *hex)
html("<h2>Tree content</h2>\n");
+ html_txt(path);
html("<table class='list'>\n");