]> git.cameronkatri.com Git - cgit.git/blobdiff - ui-tree.c
Reintroduce the branch switcher
[cgit.git] / ui-tree.c
index df05ad30171d22ce8f162e53beb8d41ae77036af..2f052c71e13077ca2caed29a419401b39062ed6b 100644 (file)
--- a/ui-tree.c
+++ b/ui-tree.c
@@ -7,6 +7,8 @@
  */
 
 #include "cgit.h"
+#include "html.h"
+#include "ui-shared.h"
 
 char *curr_rev;
 char *match_path;
@@ -34,7 +36,8 @@ static void print_object(const unsigned char *sha1, char *path)
        }
 
        html(" blob: <a href='");
-       html_attr(cgit_pageurl(ctx.qry.repo, "blob", fmt("id=%s", sha1_to_hex(sha1))));
+       html_attr(cgit_pageurl(ctx.qry.repo, "blob",
+                              fmt("id=%s&path=%s", sha1_to_hex(sha1), path)));
        htmlf("'>%s</a>",sha1_to_hex(sha1));
 
        html("<table summary='blob content' class='blob'>\n");
@@ -79,7 +82,7 @@ static int ls_item(const unsigned char *sha1, const char *base, int baselen,
        }
 
        html("<tr><td class='ls-mode'>");
-       html_filemode(mode);
+       cgit_print_filemode(mode);
        html("</td><td>");
        if (S_ISGITLINK(mode)) {
                htmlf("<a class='ls-mod' href='");