summaryrefslogtreecommitdiff
path: root/check-receive-policy
blob: 1bc8bb2190b5013f7c352d58da3fe79b8494a65d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/bin/sh -eu
set -eu

# Check if user is allowed
user=`id -un`
match=`test -f git-receive-allow && grep -Fx "$user" git-receive-allow || true`
if [ -z "$match" ]; then
	cat <<EOF >&2
---
You're not allowed to push to this repository as $user. 
---
EOF
	exit 1
fi