summaryrefslogtreecommitdiffabout
path: root/cgit.c
Unidiff
Diffstat (limited to 'cgit.c') (more/less context) (show whitespace changes)
-rw-r--r--cgit.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/cgit.c b/cgit.c
index 3943a0f..f749b6b 100644
--- a/cgit.c
+++ b/cgit.c
@@ -172,25 +172,25 @@ static int cgit_prepare_cache(struct cacheitem *item)
172 cgit_print_pageheader(&ctx); 172 cgit_print_pageheader(&ctx);
173 cgit_print_error(fmt("Unknown repo: %s", ctx.qry.repo)); 173 cgit_print_error(fmt("Unknown repo: %s", ctx.qry.repo));
174 cgit_print_docend(); 174 cgit_print_docend();
175 return 0; 175 return 0;
176 } 176 }
177 177
178 if (!ctx.repo) { 178 if (!ctx.repo) {
179 item->name = xstrdup(fmt("%s/index.html", ctx.cfg.cache_root)); 179 item->name = xstrdup(fmt("%s/index.html", ctx.cfg.cache_root));
180 item->ttl = ctx.cfg.cache_root_ttl; 180 item->ttl = ctx.cfg.cache_root_ttl;
181 return 1; 181 return 1;
182 } 182 }
183 183
184 if (!cgit_cmd) { 184 if (!ctx.qry.page) {
185 item->name = xstrdup(fmt("%s/%s/index.%s.html", ctx.cfg.cache_root, 185 item->name = xstrdup(fmt("%s/%s/index.%s.html", ctx.cfg.cache_root,
186 cache_safe_filename(ctx.repo->url), 186 cache_safe_filename(ctx.repo->url),
187 cache_safe_filename(ctx.qry.raw))); 187 cache_safe_filename(ctx.qry.raw)));
188 item->ttl = ctx.cfg.cache_repo_ttl; 188 item->ttl = ctx.cfg.cache_repo_ttl;
189 } else { 189 } else {
190 item->name = xstrdup(fmt("%s/%s/%s/%s.html", ctx.cfg.cache_root, 190 item->name = xstrdup(fmt("%s/%s/%s/%s.html", ctx.cfg.cache_root,
191 cache_safe_filename(ctx.repo->url), 191 cache_safe_filename(ctx.repo->url),
192 ctx.qry.page, 192 ctx.qry.page,
193 cache_safe_filename(ctx.qry.raw))); 193 cache_safe_filename(ctx.qry.raw)));
194 if (ctx.qry.has_symref) 194 if (ctx.qry.has_symref)
195 item->ttl = ctx.cfg.cache_dynamic_ttl; 195 item->ttl = ctx.cfg.cache_dynamic_ttl;
196 else if (ctx.qry.has_sha1) 196 else if (ctx.qry.has_sha1)