diff options
Diffstat (limited to 'custom')
-rwxr-xr-xcustom/hooks/post-receive.cgit-age13
1 file changed, 11 insertions, 2 deletions
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