From 5a9b26d3ea2996da08836703d155463fc2809470 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Mon, 28 Sep 2026 22:46:34 -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 2.12.1