X-Git-Url: https://gitweb.ps.run/ps-cgit/blobdiff_plain/5b1f42ffeec7e315fc4fcff5145e5b0adca30715..2f8648ff7f5c7119ab035c134504f04eefe068fb:/ui-shared.c diff --git a/ui-shared.c b/ui-shared.c index 50a168d..e8c0723 100644 --- a/ui-shared.c +++ b/ui-shared.c @@ -1111,7 +1111,8 @@ void cgit_compose_snapshot_prefix(struct strbuf *filename, const char *base, strbuf_addf(filename, "%s-%s", base, ref); } -void cgit_print_snapshot_links(const struct cgit_repo *repo, const char *ref) +void cgit_print_snapshot_links(const struct cgit_repo *repo, const char *ref, + const char *separator) { const struct cgit_snapshot_format* f; struct strbuf filename = STRBUF_INIT; @@ -1126,13 +1127,20 @@ void cgit_print_snapshot_links(const struct cgit_repo *repo, const char *ref) prefixlen = filename.len; for (f = cgit_snapshot_formats; f->suffix; f++) { - if (!(repo->snapshots & f->bit)) + if (!(repo->snapshots & cgit_snapshot_format_bit(f))) continue; strbuf_setlen(&filename, prefixlen); strbuf_addstr(&filename, f->suffix); cgit_snapshot_link(filename.buf, NULL, NULL, NULL, NULL, filename.buf); - html("
"); + if (cgit_snapshot_get_sig(ref, f)) { + strbuf_addstr(&filename, ".asc"); + html(" ("); + cgit_snapshot_link("sig", NULL, NULL, NULL, NULL, + filename.buf); + html(")"); + } + html(separator); } strbuf_release(&filename); }