`ensure_repo` already guarantees it is a repository, so we don't need to check if adapter is defined.