blob: 523b8de5edaeb14ae6818a452517284fa10c172a (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
#!/bin/sh
# Determine what input the hook needs
# post-update takes args, pre/post-receive take stdin
type=args
stdin=''
[ $0 != hooks/post-update ] && {
type=stdin
stdin=`cat`
}
for h in $0.*; do
[ -x $h ] || continue
if [ $type = args ]
then
$h $@ || { [ $0 = hooks/pre-receive ] && exit 1; }
else
echo "$stdin" | $h || { [ $0 = hooks/pre-receive ] && exit 1; }
fi
done
|