def METHOD_NAME(name: str, remote: str, refspec: str, clone_dir: str) -> None:
    """
    Check out the given repository.
    This is a deep (non-shallow) checkout, which differs from e3's typical
    operation.
    """
    if not os.path.exists(clone_dir):
        logging.info(
            "Checking out %s\n        from %s %s\n        to %s"
            % (name, remote, refspec, clone_dir)
        )
        subprocess.run(["git", "clone", remote, clone_dir])
        subprocess.run(["git", "checkout", refspec], cwd=clone_dir)