diff --git a/scripts/ci/auto_fix_formatting.py b/scripts/ci/auto_fix_formatting.py index 76b77fdab..ad5252819 100755 --- a/scripts/ci/auto_fix_formatting.py +++ b/scripts/ci/auto_fix_formatting.py @@ -62,7 +62,7 @@ def ensure_git_repo(api_url, repo, token, pr_number): # 强制checkout到源分支(覆盖tarball内容) # tarball是merge后的commit,源分支才是我们要修改并推送的目标 print("切换到源分支...") - run(f"git checkout -B {head_branch} FETCH_HEAD") + run(f"git checkout -B --force {head_branch} FETCH_HEAD") result = run("git status --porcelain") if result.stdout.strip():