#!/bin/sh
#
# pre-commit hook script for siglo

# Unset GIT_DIR. When invoking hooks Git sets GIT_DIR to ".git" (.git in the current directory),
# which confuses child git processes (especially ones operating on other repos).
unset GIT_DIR

# check coding
if [[ -f .git/hooks/pre-commit.contentcheck ]]; then
    .git/hooks/pre-commit.contentcheck
    ret=$?

    if [ $ret != 0 ]
    then
        exit $ret
    fi
fi

# check cpplint
if [[ -f .git/hooks/pre-commit.cpplint ]]; then
    .git/hooks/pre-commit.cpplint
    ret=$?

    if [ $ret != 0 ]
    then
        exit $ret
    fi
fi

# for private hook script
if [[ -f .git/hooks/pre-commit.private ]]; then
    .git/hooks/pre-commit.private
    ret=$?

    if [ $ret != 0 ]
    then
        exit $ret
    fi
fi
