fix check for directory and that is a git repo