aboutsummaryrefslogtreecommitdiff
path: root/ui-shared.c
diff refs
from: back
to: back
| flip
diff options
context:
space:
mode:
Diffstat (limited to 'ui-shared.c')
-rw-r--r--ui-shared.c41
1 files changed, 17 insertions, 24 deletions
diff --git a/ui-shared.c b/ui-shared.c
index 1dd8722..23a893b 100644
--- a/ui-shared.c
+++ b/ui-shared.c
@@ -559,32 +559,25 @@ void cgit_submodule_link(const char *class, char *path, const char *rev)
item = lookup_path(list, path);
}
}
- if (item || ctx.repo->module_link) {
- html("<a ");
- if (class)
- htmlf("class='%s' ", class);
- html("href='");
- if (item) {
- html_attrf(item->util, rev);
- } else {
- dir = strrchr(path, '/');
- if (dir)
- dir++;
- else
- dir = path;
- html_attrf(ctx.repo->module_link, dir, rev);
- }
- html("'>");
- html_txt(path);
- html("</a>");
+ html("<a ");
+ if (class)
+ htmlf("class='%s' ", class);
+ html("href='");
+ if (item) {
+ html_attrf(item->util, rev);
+ } else if (ctx.repo->module_link) {
+ dir = strrchr(path, '/');
+ if (dir)
+ dir++;
+ else
+ dir = path;
+ html_attrf(ctx.repo->module_link, dir, rev);
} else {
- html("<span");
- if (class)
- htmlf(" class='%s'", class);
- html(">");
- html_txt(path);
- html("</span>");
+ html("#");
}
+ html("'>");
+ html_txt(path);
+ html("</a>");
html_txtf(" @ %.7s", rev);
if (item && tail)
path[len - 1] = tail;