X-Git-Url: https://gitweb.ps.run/ps-cgit/blobdiff_plain/d1f3bbe9d22029f45a77bb938c176ccc0c827d46..b7f33786ef4b155a11b0324f84bbde5d7fc9c998:/ui-tree.c diff --git a/ui-tree.c b/ui-tree.c index df05ad3..79332fc 100644 --- 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; @@ -33,9 +35,10 @@ static void print_object(const unsigned char *sha1, char *path) return; } - html(" blob: %s",sha1_to_hex(sha1)); + html(" ("); + cgit_plain_link("plain", NULL, NULL, ctx.qry.head, + curr_rev, path); + htmlf(")
blob: %s", sha1_to_hex(sha1)); html("\n"); idx = 0; @@ -59,7 +62,8 @@ static void print_object(const unsigned char *sha1, char *path) static int ls_item(const unsigned char *sha1, const char *base, int baselen, - const char *pathname, unsigned int mode, int stage) + const char *pathname, unsigned int mode, int stage, + void *cbdata) { char *name; char *fullpath; @@ -70,16 +74,18 @@ static int ls_item(const unsigned char *sha1, const char *base, int baselen, fullpath = fmt("%s%s%s", ctx.qry.path ? ctx.qry.path : "", ctx.qry.path ? "/" : "", name); - type = sha1_object_info(sha1, &size); - if (type == OBJ_BAD && !S_ISGITLINK(mode)) { - htmlf("", - name, - sha1_to_hex(sha1)); - return 0; + if (!S_ISGITLINK(mode)) { + type = sha1_object_info(sha1, &size); + if (type == OBJ_BAD) { + htmlf("", + name, + sha1_to_hex(sha1)); + return 0; + } } html("
Bad object: %s %s
Bad object: %s %s
"); - html_filemode(mode); + cgit_print_filemode(mode); html(""); if (S_ISGITLINK(mode)) { htmlf("