aboutsummaryrefslogtreecommitdiffstats
path: root/ui-refs.c
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2018-08-03 17:52:44 +0200
committerFlorian Pritz <bluewind@xinu.at>2018-08-03 17:52:44 +0200
commit42f8840323a219d3eca59a7a2a388c3a28eeb8fb (patch)
treeec799ab66ed4119b68268192ea8fbe62a96b51aa /ui-refs.c
parent343a8b8ee33f9a181e662fc0e3a3979dd9b52dd4 (diff)
parent824138e59194acaf5efe53690d4ef6eaf38e1549 (diff)
downloadcgit-local.tar.gz
cgit-local.tar.xz
Merge branch 'master' of https://git.zx2c4.com/cgit into localHEADlocal
Diffstat (limited to 'ui-refs.c')
-rw-r--r--ui-refs.c30
1 files changed, 1 insertions, 29 deletions
diff --git a/ui-refs.c b/ui-refs.c
index 75f2789..2ec3858 100644
--- a/ui-refs.c
+++ b/ui-refs.c
@@ -90,34 +90,6 @@ static void print_tag_header(void)
"<th class='left' colspan='2'>Age</th></tr>\n");
}
-static void print_tag_downloads(const struct cgit_repo *repo, const char *ref)
-{
- const struct cgit_snapshot_format* f;
- const char *basename;
- struct strbuf filename = STRBUF_INIT;
- size_t prefixlen;
-
- if (!ref || strlen(ref) < 1)
- return;
-
- basename = cgit_repobasename(repo->url);
- if (starts_with(ref, basename))
- strbuf_addstr(&filename, ref);
- else
- cgit_compose_snapshot_prefix(&filename, basename, ref);
- prefixlen = filename.len;
- for (f = cgit_snapshot_formats; f->suffix; f++) {
- if (!(repo->snapshots & f->bit))
- continue;
- strbuf_setlen(&filename, prefixlen);
- strbuf_addstr(&filename, f->suffix);
- cgit_snapshot_link(filename.buf, NULL, NULL, NULL, NULL, filename.buf);
- html("&nbsp;&nbsp;");
- }
-
- strbuf_release(&filename);
-}
-
static int print_tag(struct refinfo *ref)
{
struct tag *tag = NULL;
@@ -137,7 +109,7 @@ static int print_tag(struct refinfo *ref)
cgit_tag_link(name, NULL, NULL, name);
html("</td><td>");
if (ctx.repo->snapshots && (obj->type == OBJ_COMMIT))
- print_tag_downloads(ctx.repo, name);
+ cgit_print_snapshot_links(ctx.repo, name, "&nbsp;&nbsp;");
else
cgit_object_link(obj);
html("</td><td>");