{% block tree_listing_item(const struct object_id *oid, struct strbuf *base, const char *pathname, unsigned mode, bool border_above) %} {# Directory listing entry #} {! unsigned long size = 0; if (!S_ISGITLINK(mode)) { oid_object_info(the_repository, oid, &size); } struct strbuf fullpath = STRBUF_INIT; strbuf_addf(&fullpath, "%s%s", base->buf, pathname); !}
{# File icon #} {% if S_ISGITLINK(mode) %} {# Heroicons solid folder #} {% elif S_ISDIR(mode) %} {# Heroicons solid folder #} {% elif S_ISLNK(mode) %} {# Heroicons outline link #} {% else %} {# Heroicons outline document #} {% endif %}
{# File name and link #} {% if S_ISGITLINK(mode) %} {! cgit_submodule_link("ls-mod", fullpath.buf, pathname, oid_to_hex(oid)); !} {% else %} {{ pathname }} {% endif %}
{# Mode #} {! cgit_print_filemode(mode); !}
{# File size #} {% if !S_ISGITLINK(mode) && !S_ISDIR(mode) && !S_ISLNK(mode) %} {{ size|%ld }} {% endif %}
{! strbuf_release(&fullpath); !} {% endblock %}