#!/bin/sh
set -eu

# Keep the configured global checks when this checkout opts into repository hooks.
global_hooks=$(git config --global --path --get core.hooksPath || :)
if [ -n "$global_hooks" ] && [ -x "$global_hooks/pre-commit" ] &&
   [ ! "$global_hooks/pre-commit" -ef "$0" ]; then
    "$global_hooks/pre-commit"
fi
exec make test-changed
