diff options
author | Lars Hjemli <hjemli@gmail.com> | 2011-06-15 17:10:41 (JST) |
---|---|---|
committer | Lars Hjemli <hjemli@gmail.com> | 2011-06-15 17:40:13 (JST) |
commit | 7421857b4da9b8523032f08824bca9f3e3ebec4e (patch) | |
tree | dde9cdb37203cc3c9466017f3c2ac8fc803bf5e9 /ui-plain.c | |
parent | 6857bec50a52340fa6b85d626f49d45dd331ed0e (diff) | |
download | cgit-7421857b4da9b8523032f08824bca9f3e3ebec4e.zip cgit-7421857b4da9b8523032f08824bca9f3e3ebec4e.tar.gz |
ui-plain.c: add support for path-selected submodule links
In ui-plain.c, the links generated for submodule entry ignored the fact
that the entry was in fact a submodule. This patch adds proper submodule
links to the plain directory listings.
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Diffstat (limited to 'ui-plain.c')
-rw-r--r-- | ui-plain.c | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -97,11 +97,14 @@ static void print_dir_entry(const unsigned char *sha1, const char *base, | |||
97 | char *fullpath; | 97 | char *fullpath; |
98 | 98 | ||
99 | fullpath = buildpath(base, baselen, path); | 99 | fullpath = buildpath(base, baselen, path); |
100 | if (!S_ISDIR(mode)) | 100 | if (!S_ISDIR(mode) && !S_ISGITLINK(mode)) |
101 | fullpath[strlen(fullpath) - 1] = 0; | 101 | fullpath[strlen(fullpath) - 1] = 0; |
102 | html(" <li>"); | 102 | html(" <li>"); |
103 | cgit_plain_link(path, NULL, NULL, ctx.qry.head, ctx.qry.sha1, | 103 | if (S_ISGITLINK(mode)) { |
104 | fullpath); | 104 | cgit_submodule_link(NULL, fullpath, sha1_to_hex(sha1)); |
105 | } else | ||
106 | cgit_plain_link(path, NULL, NULL, ctx.qry.head, ctx.qry.sha1, | ||
107 | fullpath); | ||
105 | html("</li>\n"); | 108 | html("</li>\n"); |
106 | match = 2; | 109 | match = 2; |
107 | } | 110 | } |