X-Git-Url: https://gitweb.ps.run/ps-cgit/blobdiff_plain/5cd2bf7e7f3f3daf6107cd3a269bad78e342de70..47a81c77fdd017227632c4df9a0b7b135b8a738d:/ui-tree.c diff --git a/ui-tree.c b/ui-tree.c index ed9f05e..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(" |
|---|