From 783ff95ab8c2ccc42901200bdc25a426377a3886 Mon Sep 17 00:00:00 2001 From: Charlie Date: Wed, 28 Oct 2009 13:58:26 -0600 Subject: Add policy checks --- pre-receive | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'pre-receive') 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 <&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 -- cgit v1.2.3