脚本修改
Some checks failed
API接口参数变更检测 / api-param-check (push) Has been cancelled

This commit is contained in:
2026-06-03 15:33:24 +08:00
parent 6db621a137
commit 2c20a26af8
15 changed files with 136 additions and 897 deletions

View File

@@ -122,6 +122,20 @@ def get_controller_files_diff(base_sha: str, head_sha: str, changed_files: List[
return ""
def get_file_content_at_commit(commit_sha: str, file_path: str) -> Optional[str]:
"""
读取指定 commit 下某个文件的内容(无需 git worktree更快
:param commit_sha: commit SHA
:param file_path: 相对仓库根目录的文件路径
:return: 文件内容;该 commit 中不存在则返回 None
"""
try:
return run_git(["show", f"{commit_sha}:{file_path}"])
except RuntimeError:
return None
def prepare_worktrees(repo_root: Path) -> tuple:
"""
准备新旧两个版本的代码工作目录,供 AST 解析器分别扫描。