#!/bin/sh

. config/.env.gild.lib

if [ $MASTER_PUSH_CONTROL ] && [ $MASTER_PUSH_CONTROL = off -o $MASTER_PUSH_CONTROL = no ]; then
    exit 0
fi


while read local_ref local_sha remote_ref remote_sha
do
    # masterへのpush禁止
    if [[ "${remote_ref##refs/heads/}" = "master" ]]; then
        echo $'\e[1;31morigin/masterへはpushできません。\e[0m'
        exit 1
    fi
done

# コーディングチェックエラーがあればpushはしない。
. vendor/gild-lib/git-hooks/laravel/php-codesniffer/code_check.sh

exit 0
