23 lines
375 B
Bash
Executable file
23 lines
375 B
Bash
Executable file
#!/bin/bash
|
|
#
|
|
# author: orefalo
|
|
|
|
hookname=`basename $0`
|
|
|
|
|
|
FILE=`mktemp`
|
|
trap 'rm -f $FILE' EXIT
|
|
cat - > $FILE
|
|
|
|
for hook in $GIT_DIR/hooks/$hookname.*
|
|
do
|
|
if test -x "$hook"; then
|
|
cat $FILE | $hook "$@"
|
|
status=$?
|
|
|
|
if test $status -ne 0; then
|
|
echo Hook $hook failed with error code $status
|
|
exit $status
|
|
fi
|
|
fi
|
|
done
|