X-Git-Url: https://gitweb.ps.run/ps-cgit/blobdiff_plain/b1f9b9c1459cb9a30ebf80721aff6ef788d1f891..29b37e9781ce1bb04e558c7490d2c29eb1a477e5:/ui-tree.c diff --git a/ui-tree.c b/ui-tree.c index 7912784..5a2dd3f 100644 --- a/ui-tree.c +++ b/ui-tree.c @@ -8,6 +8,7 @@ #include "cgit.h" #include "html.h" +#include "ui-shared.h" char *curr_rev; char *match_path; @@ -35,7 +36,8 @@ static void print_object(const unsigned char *sha1, char *path) } html(" blob: %s",sha1_to_hex(sha1)); html("\n"); @@ -71,12 +73,14 @@ 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
");