Diff options
Diffstat (limited to 'custom')
| -rwxr-xr-x | custom/hooks/post-receive.cgit-cache | 10 |
1 file changed, 7 insertions, 3 deletions
diff --git a/custom/hooks/post-receive.cgit-cache b/custom/hooks/post-receive.cgit-cache index 8aae60b..b92683a 100755 --- a/custom/hooks/post-receive.cgit-cache +++ b/custom/hooks/post-receive.cgit-cache @@ -7,8 +7,9 @@ # cgit writes the request each slot answers at the head of the slot file, so # the hook reads it back and drops only this repository's pages and the # repository index, whose idle column the push changes. Other repositories -# keep their cached pages. The cached repository scan goes too, which is what -# makes a brand new repository appear without waiting out cache-scan-ttl. +# keep their cached pages, bar any asked for with an escaped query. The cached +# repository scan goes too, which is what makes a brand new repository appear +# without waiting out cache-scan-ttl. # # The hook needs the url cgit serves this repository at. A repository that # scan-path finds is served at its path below scan_path, as set below, so @@ -77,7 +78,8 @@ take() { # Whether the page a slot holds goes stale with this push: one of this # repository's, by path or by the url and r parameters, or the index. A key # that does not read as cgit's counts as stale, since dropping a page costs -# only a refill. +# only a refill, and so does a query with a % or a + in it, since only +# decoding it would tell which repository it names. stale() { rest=$1 take && take && take || return 0 @@ -99,6 +101,8 @@ stale() { ;; *"&url=&"* | *"&url=/&"*) ;; + *"&url="*[%+]* | *"&r="*[%+]*) + ;; *"&url="* | *"&r="*) return 1 ;; |
