]> gitweb.ps.run Git - ps-cgit/blobdiff - ui-plain.c
ui-repolist: Rename section-sort to repository-sort.
[ps-cgit] / ui-plain.c
index 7fecc32e1a970fdb3c51575e44072036222718d2..85877d774bfd40016b1b39267acb17b231569928 100644 (file)
@@ -147,11 +147,14 @@ static void print_dir_entry(const unsigned char *sha1, const char *base,
        char *fullpath;
 
        fullpath = buildpath(base, baselen, path);
-       if (!S_ISDIR(mode))
+       if (!S_ISDIR(mode) && !S_ISGITLINK(mode))
                fullpath[strlen(fullpath) - 1] = 0;
        html("  <li>");
-       cgit_plain_link(path, NULL, NULL, ctx.qry.head, ctx.qry.sha1,
-                       fullpath);
+       if (S_ISGITLINK(mode)) {
+               cgit_submodule_link(NULL, fullpath, sha1_to_hex(sha1));
+       } else
+               cgit_plain_link(path, NULL, NULL, ctx.qry.head, ctx.qry.sha1,
+                               fullpath);
        html("</li>\n");
        match = 2;
 }