def get_changed_files(repo_root: Path, base_ref: str = "main") -> list[Path]:
    """Use git to get the list of files changed compared to the base branch."""
    try:
        cmd = ["git", "diff", "--name-only", f"{base_ref}...HEAD"]
        result = subprocess.run(cmd, cwd=repo_root, text=True, capture_output=True)
        if result.returncode != 0:
            raise RuntimeError(f"Git command failed: {result.stderr}")

        return [repo_root / Path(f) for f in result.stdout.splitlines() if f.strip()]
    except Exception as e:
        print(f"Exception occurred: {e!s}")
        raise
Use git to get the list of files changed compared to the base branch.
llama-dev/llama_dev/utils.py