about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2013-05-28 16:43:02 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2013-08-12 13:14:10 -0600
commit00e3a3ecda77bf5ab149db0940c549f1bb618de4 (patch)
tree887b4fec5fa60945dc4d0c6919efbbbe4ef7216c
parentcache: document negative ttls and add about ttl (diff)
downloadcgit-pink-00e3a3ecda77bf5ab149db0940c549f1bb618de4.tar.gz
cgit-pink-00e3a3ecda77bf5ab149db0940c549f1bb618de4.zip
cache: id means static, even if head is specified too
Pages like /commit?h=wip&id=8a335ce618ba77fbf05148d6f8be17bd48ba4340
were being marked as dynamic, because of h=wip, when it should be
static, because of id=.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
-rw-r--r--cgit.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/cgit.c b/cgit.c
index a45ce1f..861352a 100644
--- a/cgit.c
+++ b/cgit.c
@@ -928,12 +928,12 @@ static int calc_ttl()
 	if (!strcmp(ctx.qry.page, "about"))
 		return ctx.cfg.cache_about_ttl;
 
-	if (ctx.qry.has_symref)
-		return ctx.cfg.cache_dynamic_ttl;
-
 	if (ctx.qry.has_sha1)
 		return ctx.cfg.cache_static_ttl;
 
+	if (ctx.qry.has_symref)
+		return ctx.cfg.cache_dynamic_ttl;
+
 	return ctx.cfg.cache_repo_ttl;
 }
 
nroe 2022-04-03Publish "Care"June McEnroe 2022-03-31Publish "Compassion"June McEnroe 2022-03-24Skip matches with ident chars on either sideJune McEnroe This fixes, for example, where the link gets placed on static regex_t regex(const char *pattern, int flags) in title.c. 2022-03-24Add The Invisible Life of Addie LaRueJune McEnroe So good, but so long. Reminded me of The Ten Thousand Doors of January at the beginning, and more of that N. K. Jemisin series about gods later. I like this interacting with gods and becoming something like one sort of thing. God, it took me a whole month (more?) to read and this is only my third book of the year :( I need some more novellas to read, but the other books I have from the library currently are also thick. 2022-03-22Source ~/.profile.local if it existsJune McEnroe 2022-03-18Publish "Addendum 2021"June McEnroe 2022-03-16Remove wcwidth portJune McEnroe DYLD_FORCE_FLAT_NAMESPACE no longer exists in macOS 12 so this approach doesn't work anymore. Moved to <https://git.causal.agency/jorts/tree/wcwidth> and compiled into <https://git.causal.agency/jorts/tree/ncurses>. 2022-03-16Remove -j4 from ./PlanJune McEnroe Plan learned to set this automatically! 2022-03-15Rewrite Linux install.sh for DebianJune McEnroe 2022-03-15Remove dashJune McEnroe