Better directory checking for repo roots.