Encapsulate conditional logic in pull_repo