Discovers branches in the repository.