aboutsummaryrefslogtreecommitdiffstats
path: root/ui-shared.c
diff options
context:
space:
mode:
Diffstat (limited to 'ui-shared.c')
-rw-r--r--ui-shared.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/ui-shared.c b/ui-shared.c
index e719c1b..d857873 100644
--- a/ui-shared.c
+++ b/ui-shared.c
@@ -152,6 +152,14 @@ const char *cgit_repobasename(const char *reponame)
152 return rvbuf; 152 return rvbuf;
153} 153}
154 154
155const char *cgit_snapshot_prefix(const struct cgit_repo *repo)
156{
157 if (repo->snapshot_prefix)
158 return repo->snapshot_prefix;
159
160 return cgit_repobasename(repo->url);
161}
162
155static void site_url(const char *page, const char *search, const char *sort, int ofs, int always_root) 163static void site_url(const char *page, const char *search, const char *sort, int ofs, int always_root)
156{ 164{
157 char *delim = "?"; 165 char *delim = "?";
@@ -1110,7 +1118,7 @@ void cgit_print_snapshot_links(const struct cgit_repo *repo, const char *head,
1110 struct strbuf filename = STRBUF_INIT; 1118 struct strbuf filename = STRBUF_INIT;
1111 size_t prefixlen; 1119 size_t prefixlen;
1112 1120
1113 cgit_compose_snapshot_prefix(&filename, cgit_repobasename(repo->url), hex); 1121 cgit_compose_snapshot_prefix(&filename, cgit_snapshot_prefix(repo), hex);
1114 prefixlen = filename.len; 1122 prefixlen = filename.len;
1115 for (f = cgit_snapshot_formats; f->suffix; f++) { 1123 for (f = cgit_snapshot_formats; f->suffix; f++) {
1116 if (!(repo->snapshots & f->bit)) 1124 if (!(repo->snapshots & f->bit))