Ensure GIT_DIR is set

Add some sanity checking to ensure the environment the hook is running
in has GIT_DIR set, so as to ensure there is a git repository to
operate on.