fix(ci): auto-fix checkout加--force,避免tarball untracked文件冲突 #643
Reference in New Issue
Block a user
Delete Branch "fix/ci-autofix-checkout-force"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
问题
Validate使用tarball方式checkout代码,auto-fix脚本执行
git checkout -B切换到源分支时,tarball留下的untracked文件会导致checkout失败。修复
git checkout -B加--force参数,强制覆盖untracked文件。关联
📊 审查概览
❌ 需修改的问题(严重)
git checkout -B命令的语法要求紧跟其后的参数是新分支的名称。当前代码将--force放在-B之后,Git 会将--force解析为分支名,而将{head_branch}解析为起始点(start_point),导致命令执行失败或产生错误的分支。--force(或-f)选项移到-B之前。修改为:💡 改进建议(一般)
无
✅ 良好实践
🤖 由 AI 代码审查机器人自动生成 | 2026-07-20 14:18:58 | 模型:
🗑️ 预览环境已清理
PR #643 已关闭或合并,对应的预览环境已被清理。