fix(flow): 修复 _merge_normal 使用 merge_squash 替代错误的 reset_soft 逻辑

This commit is contained in:
2025-12-17 06:00:25 +08:00
parent c6569bf05b
commit afa676314e

View File

@@ -319,9 +319,9 @@ class BranchManager:
branch_info: BranchInfo, branch_info: BranchInfo,
task_summary: str, task_summary: str,
) -> tuple[bool, str]: ) -> tuple[bool, str]:
"""正常合并流程:软重置 + 压缩提交""" """正常合并流程:squash 合并任务分支到源分支"""
source_branch = branch_info.source_branch source_branch = branch_info.source_branch
start_commit = branch_info.start_commit task_branch = branch_info.branch_name
# 切换分支前清理 lock 文件,避免冲突 # 切换分支前清理 lock 文件,避免冲突
self._cleanup_lock_file() self._cleanup_lock_file()
@@ -329,8 +329,8 @@ class BranchManager:
# 切回源分支 # 切回源分支
self.git.checkout(source_branch) self.git.checkout(source_branch)
# 软重置到起始提交 # squash 合并任务分支
self.git.reset_soft(start_commit) self.git.merge_squash(task_branch)
# 创建压缩提交 # 创建压缩提交
self.git.add_all() self.git.add_all()