Skip to content

fix(api): stash uncommitted changes before merge-pr delete-branch#389

Open
arielshad wants to merge 1 commit intomainfrom
fix/stash-before-merge-pr
Open

fix(api): stash uncommitted changes before merge-pr delete-branch#389
arielshad wants to merge 1 commit intomainfrom
fix/stash-before-merge-pr

Conversation

@arielshad
Copy link
Copy Markdown
Contributor

Summary

  • Stashes uncommitted changes before running gh pr merge --delete-branch to prevent branch deletion from failing when the worktree is dirty
  • Uses a finally block to restore (pop) stashed changes even if the merge itself fails
  • Skips stash entirely when the working tree is clean (no overhead)

Test plan

  • Unit test: stash + merge + pop when worktree is dirty
  • Unit test: skip stash when worktree is clean
  • Unit test: stash pop runs even when merge fails
  • Unit test: merge strategy passthrough still works
  • All 62 existing git-pr service tests pass

🤖 Generated with Claude Code

Prevents --delete-branch from failing when the worktree has uncommitted
changes. Changes are stashed before gh pr merge and restored (popped)
in a finally block so they survive even if the merge itself fails.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

Dev Release Published

Artifact Version Install
npm 1.121.0-pr389.4b54f12 npm install -g @shepai/cli@1.121.0-pr389.4b54f12

Published from commit 104d6ed | View CI

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