From 62ee8640a69b6025a0d8d5db45b301811d52cac8 Mon Sep 17 00:00:00 2001 From: CI Bot Date: Tue, 21 Jul 2026 00:13:15 +0800 Subject: [PATCH] =?UTF-8?q?fix(ci):=20=E4=BF=AE=E5=A4=8D=20auto=5Ffix=5Ffo?= =?UTF-8?q?rmatting.py=20=E4=B8=AD=20git=20checkout=20=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E9=A1=BA=E5=BA=8F=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -B --force 会将 --force 解析为分支名导致失败 改为 -f -B 正确语法,确保 tarball checkout 模式下能正常切换到源分支 --- scripts/ci/auto_fix_formatting.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/ci/auto_fix_formatting.py b/scripts/ci/auto_fix_formatting.py index ad5252819..b6470c642 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 --force {head_branch} FETCH_HEAD") + run(f"git checkout -f -B {head_branch} FETCH_HEAD") result = run("git status --porcelain") if result.stdout.strip(): -- 2.54.0