aboutsummaryrefslogtreecommitdiff
path: root/ui-plain.c
diff options
context:
space:
mode:
authorLars Hjemli <hjemli@gmail.com>2012-03-18 20:59:36 +0000
committerLars Hjemli <hjemli@gmail.com>2012-03-18 20:59:36 +0000
commit2b9fab8d30420d935745c4d84ea22412ab2485e5 (patch)
tree664ebc3d061fd7e89393af67bfbc406f3b600be0 /ui-plain.c
parent08352c7a02f057f6cbaf817ca7e53c53be590a62 (diff)
parent3fbaf097153b239b092d11a178ace96671f9f3ec (diff)
downloadcgit-2b9fab8d30420d935745c4d84ea22412ab2485e5.tar
cgit-2b9fab8d30420d935745c4d84ea22412ab2485e5.tar.gz
cgit-2b9fab8d30420d935745c4d84ea22412ab2485e5.zip
Merge branch 'lh/module-links'
Diffstat (limited to 'ui-plain.c')
-rw-r--r--ui-plain.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/ui-plain.c b/ui-plain.c
index 733db4d..2abd210 100644
--- a/ui-plain.c
+++ b/ui-plain.c
@@ -97,11 +97,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;
}