Added directory walking to find the repository.