From d3843d12cd101975120dc8cd8e02874790951382 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Fri, 16 Oct 2026 06:31:19 -1000 Subject: Keep the age hook's directory group writable The hook forced a 022 umask, so in a repository shared with a group the first pusher owned info/web and every other member's push failed to write the age file there. --- custom/hooks/post-receive.cgit-age | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'custom') diff --git a/custom/hooks/post-receive.cgit-age b/custom/hooks/post-receive.cgit-age index 0567e08..a87e325 100755 --- a/custom/hooks/post-receive.cgit-age +++ b/custom/hooks/post-receive.cgit-age @@ -8,8 +8,17 @@ set -eu # The pushing user's umask decides the mode of a freshly written agefile, so -# force one that leaves the file readable by the web server. -umask 022 +# force one that leaves the file readable by the web server. A repository +# shared with a group, which git keeps group writable, keeps the directory +# that way too, or the next member to push could not replace the file. +case "$(git config --get core.sharedRepository | tr '[:upper:]' '[:lower:]')" in +""|umask|0|false|no|off) + umask 022 + ;; +*) + umask 002 + ;; +esac agefile="$(git rev-parse --git-dir)"/info/web/last-modified -- cgit