summaryrefslogtreecommitdiff
path: root/pre-receive
blob: 423298325b890a99e1ae10427ba51ed1efbc04ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/sh -eu
set -eu

user=`id -un`

# 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