about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--ui-refs.c27
1 files changed, 1 insertions, 26 deletions
diff --git a/ui-refs.c b/ui-refs.c index 7b95e8b..2ec3858 100644 --- a/ui-refs.c +++ b/ui-refs.c
@@ -90,31 +90,6 @@ static void print_tag_header(void)
90 "<th class='left' colspan='2'>Age</th></tr>\n"); 90 "<th class='left' colspan='2'>Age</th></tr>\n");
91} 91}
92 92
93static void print_tag_downloads(const struct cgit_repo *repo, const char *ref)
94{
95 const struct cgit_snapshot_format* f;
96 const char *basename;
97 struct strbuf filename = STRBUF_INIT;
98 size_t prefixlen;
99
100 basename = cgit_snapshot_prefix(repo);
101 if (starts_with(ref, basename))
102 strbuf_addstr(&filename, ref);
103 else
104 cgit_compose_snapshot_prefix(&filename, basename, ref);
105 prefixlen = filename.len;
106 for (f = cgit_snapshot_formats; f->suffix; f++) {
107 if (!(repo->snapshots & f->bit))
108 continue;
109 strbuf_setlen(&filename, prefixlen);
110 strbuf_addstr(&filename, f->suffix);
111 cgit_snapshot_link(filename.buf, NULL, NULL, NULL, NULL, filename.buf);
112 html("&nbsp;&nbsp;");
113 }
114
115 strbuf_release(&filename);
116}
117
118static int print_tag(struct refinfo *ref) 93static int print_tag(struct refinfo *ref)
119{ 94{
120 struct tag *tag = NULL; 95 struct tag *tag = NULL;
@@ -134,7 +109,7 @@ static int print_tag(struct refinfo *ref)
134 cgit_tag_link(name, NULL, NULL, name); 109 cgit_tag_link(name, NULL, NULL, name);
135 html("</td><td>"); 110 html("</td><td>");
136 if (ctx.repo->snapshots && (obj->type == OBJ_COMMIT)) 111 if (ctx.repo->snapshots && (obj->type == OBJ_COMMIT))
137 print_tag_downloads(ctx.repo, name); 112 cgit_print_snapshot_links(ctx.repo, name, "&nbsp;&nbsp;");
138 else 113 else
139 cgit_object_link(obj); 114 cgit_object_link(obj);
140 html("</td><td>"); 115 html("</td><td>");