$GIT_DIR is not always set, apparently