diff options
| author | Bryce Kwon <bryce@brycekwon.com> | |
|---|---|---|
| committer | Bryce Kwon <bryce@brycekwon.com> | |
| commit | ||
| parent | ||
| tree | ||
| download | ||
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.
Diffstat (limited to 'custom/hooks')
| -rwxr-xr-x | custom/hooks/post-receive.cgit-age | 13 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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 |
