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>
这个提交包含在:
父节点
6857bec50a
当前提交
7421857b4d
@ -97,11 +97,14 @@ static void print_dir_entry(const unsigned char *sha1, const char *base,
|
|||||||
char *fullpath;
|
char *fullpath;
|
||||||
|
|
||||||
fullpath = buildpath(base, baselen, path);
|
fullpath = buildpath(base, baselen, path);
|
||||||
if (!S_ISDIR(mode))
|
if (!S_ISDIR(mode) && !S_ISGITLINK(mode))
|
||||||
fullpath[strlen(fullpath) - 1] = 0;
|
fullpath[strlen(fullpath) - 1] = 0;
|
||||||
html(" <li>");
|
html(" <li>");
|
||||||
cgit_plain_link(path, NULL, NULL, ctx.qry.head, ctx.qry.sha1,
|
if (S_ISGITLINK(mode)) {
|
||||||
fullpath);
|
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");
|
html("</li>\n");
|
||||||
match = 2;
|
match = 2;
|
||||||
}
|
}
|
||||||
|
正在加载...
在新工单中引用
屏蔽一个用户