X-Git-Url: https://gitweb.ps.run/ps-cgit/blobdiff_plain/777faf7e509e1de2b795b2a326ff00c9bd799104..a342ac6b4d7830f82230b0f6a29bc9378d66747e:/ui-tree.c diff --git a/ui-tree.c b/ui-tree.c index 1d07e70..db63e13 100644 --- a/ui-tree.c +++ b/ui-tree.c @@ -8,54 +8,69 @@ #include "cgit.h" +char *curr_rev; -static int print_entry(const unsigned char *sha1, const char *base, - int baselen, const char *pathname, unsigned int mode, +static int print_entry(const unsigned char *sha1, const char *base, + int baselen, const char *pathname, unsigned int mode, int stage) { char *name; - char type[20]; - unsigned long size; + enum object_type type; + unsigned long size = 0; - if (sha1_object_info(sha1, type, &size)) { - cgit_print_error(fmt("Bad object name: %s", - sha1_to_hex(sha1))); + name = xstrdup(pathname); + type = sha1_object_info(sha1, &size); + if (type == OBJ_BAD && !S_ISDIRLNK(mode)) { + htmlf("
| Mode | "); html("Name | "); html("Size | "); + html(""); html(" |
|---|