Skip to content

fix(pr-merge) - fix stuck on merge#296

Merged
zevwings merged 1 commit into
masterfrom
bugfix/fix-stuck-on-merge
Feb 23, 2026
Merged

fix(pr-merge) - fix stuck on merge#296
zevwings merged 1 commit into
masterfrom
bugfix/fix-stuck-on-merge

Conversation

@zevwings
Copy link
Copy Markdown
Owner

PR Ready

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Refactoring (non-breaking change which does not change functionality)
  • Hotfix (urgent fix for production issues)
  • Chore (maintenance tasks and non-functional changes)

Summary

修复 PR 合并后分支清理卡住的问题,确保在 squash‑merge 场景下也能自动删除本地分支。

Key Changes

  • 删除重复的 import 语句
  • 默认使用 force=true 删除本地分支
  • 新增对 BranchNotFullyMerged 错误的交互式强制删除提示
  • 加入删除前后的 log_info 日志
  • 移除冗余的警告日志

Changes

Bug Fixes

  • 改进分支删除逻辑,解决因未完全合并导致的卡顿
  • 优化日志输出,提升可观测性

Refactors

  • 清理重复的 import,遵循 DRY 原则

Impact Analysis

Affected Modules

Module Impact Severity
pr merge command 分支删除行为改为默认强制删除,并在特定错误时提供交互式确认。 medium

Risk Assessment

Overall risk: medium

Risk factors:

  • 默认强制删除可能误删仍有价值的提交
  • 新增的交互式确认路径若被跳过,可能导致用户未意识到强制删除的风险

Mitigation:

  • 在实际强制删除前保留一次非强制尝试,确保用户有机会审查
  • 为 squash‑merge 场景编写单元/集成测试,验证分支安全删除

Testing Suggestions

  • 模拟 squash‑merge 场景,确认分支能够被自动强制删除
  • 验证在出现 BranchNotFullyMerged 错误时,交互式确认流程正常工作
  • 检查日志输出是否包含预期的 log_info! 信息

Statistics

Metric Value
Total files 1
Additions +7
Deletions -34
Net change -27
Added files 0
Modified files 1
Deleted files 0
Renamed files 0

Review Info

  • Complexity: medium
  • Review priority: medium
  • Estimated review time: 15 minutes
  • Tags: bugfix, pr-merge, branch-cleanup

@zevwings zevwings merged commit dc51f61 into master Feb 23, 2026
13 checks passed
@zevwings zevwings deleted the bugfix/fix-stuck-on-merge branch February 23, 2026 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant