If you just run .git/hooks/pre-commit from the shell, the git related environment variables won't be set oup.