diff options
author | Charlie <root@dev.ws.local> | 2009-10-28 13:58:26 -0600 |
---|---|---|
committer | Charlie <root@dev.ws.local> | 2009-10-28 13:58:26 -0600 |
commit | 783ff95ab8c2ccc42901200bdc25a426377a3886 (patch) | |
tree | e8033f0c520377e45ff6e0b426ac7207a821e873 /pre-receive | |
parent | 4a46bf92e6306458ed0cfc375c71618c648ac85a (diff) |
Add policy checks
Diffstat (limited to 'pre-receive')
-rwxr-xr-x | pre-receive | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/pre-receive b/pre-receive index 4232983..ec9c461 100755 --- a/pre-receive +++ b/pre-receive @@ -1,16 +1,12 @@ #!/bin/sh -eu set -eu -user=`id -un` +BASE="/data/git/bin" -# Check if user is allowed -match=`test -f git-receive-allow && grep -Fx "$user" git-receive-allow || true` -echo $match > /tmp/match.log -if [ -z "$match" ]; then - cat <<EOF >&2 ---- -You're not allowed to push to this repository as $user. ---- -EOF - exit 1 -fi +# Check receive policy +$BASE/check-receive-policy + +# Check commit policy for each one +while read oldrev newrev refname; do + $BASE/check-rev-policy $oldrev $newrev $refname || exit 1 +done |