]> gitweb.ps.run Git - ps-cgit/blobdiff - ui-shared.c
ui-snapshot: pass repo into get_ref_from_filename()
[ps-cgit] / ui-shared.c
index ce806f6f4acefbeadf829d18cafe54d527122029..e719c1b00303e7258df96f18a96b0c1482217ef7 100644 (file)
@@ -10,6 +10,7 @@
 #include "ui-shared.h"
 #include "cmd.h"
 #include "html.h"
+#include "version.h"
 
 static const char cgit_doctype[] =
 "<!DOCTYPE html>\n";
@@ -785,8 +786,8 @@ void cgit_print_docend(void)
        if (ctx.cfg.footer)
                html_include(ctx.cfg.footer);
        else {
-               htmlf("<div class='footer'>generated by <a href='https://git.zx2c4.com/cgit/about/'>cgit %s</a> at ",
-                       cgit_version);
+               htmlf("<div class='footer'>generated by <a href='https://git.zx2c4.com/cgit/about/'>cgit %s</a> "
+                       "(<a href='https://git-scm.com/'>git %s</a>) at ", cgit_version, git_version_string);
                html_txt(show_date(time(NULL), 0, cgit_date_mode(DATE_ISO8601)));
                html("</div>\n");
        }
@@ -1102,17 +1103,17 @@ void cgit_compose_snapshot_prefix(struct strbuf *filename, const char *base,
        strbuf_addf(filename, "%s-%s", base, ref);
 }
 
-void cgit_print_snapshot_links(const char *repo, const char *head,
-                              const char *hex, int snapshots)
+void cgit_print_snapshot_links(const struct cgit_repo *repo, const char *head,
+                              const char *hex)
 {
        const struct cgit_snapshot_format* f;
        struct strbuf filename = STRBUF_INIT;
        size_t prefixlen;
 
-       cgit_compose_snapshot_prefix(&filename, cgit_repobasename(repo), hex);
+       cgit_compose_snapshot_prefix(&filename, cgit_repobasename(repo->url), hex);
        prefixlen = filename.len;
        for (f = cgit_snapshot_formats; f->suffix; f++) {
-               if (!(snapshots & f->bit))
+               if (!(repo->snapshots & f->bit))
                        continue;
                strbuf_setlen(&filename, prefixlen);
                strbuf_addstr(&filename, f->suffix);