Skip to content

Fix: reparent children when deleting a branch#36

Open
vpalcar wants to merge 1 commit intofix/getBranchCommits-parsingfrom
fix/deleteBranch-reparent-children
Open

Fix: reparent children when deleting a branch#36
vpalcar wants to merge 1 commit intofix/getBranchCommits-parsingfrom
fix/deleteBranch-reparent-children

Conversation

@vpalcar
Copy link
Copy Markdown
Owner

@vpalcar vpalcar commented Mar 26, 2026

Summary

  • deleteBranch left children orphaned with dangling parent pointers when deleting a mid-stack branch
  • Now reparents children to the deleted branch's parent before removing, mirroring the insert mode logic in createBranch

Stacked on #35

Test plan

  • Delete a mid-stack branch and verify children are reparented to the deleted branch's parent
  • Delete a leaf branch and verify no side effects
  • Verify stack tree (pile log) is correct after deletion

🤖 Generated with Claude Code

When deleting a branch that has children, the children were left orphaned
with dangling parent pointers. Now reparents children to the deleted
branch's parent before removing, matching the inverse of insert mode logic.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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