claude-issue-solver 1.26.1 → 1.26.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/merge.js +7 -9
- package/package.json +1 -1
package/dist/commands/merge.js
CHANGED
|
@@ -248,6 +248,13 @@ async function mergeCommand() {
|
|
|
248
248
|
for (const pr of selected) {
|
|
249
249
|
const prSpinner = (0, ora_1.default)(`Merging PR #${pr.number}...`).start();
|
|
250
250
|
try {
|
|
251
|
+
// Clean up worktree FIRST (before merge) to avoid branch deletion issues
|
|
252
|
+
try {
|
|
253
|
+
cleanupWorktree(projectRoot, pr.headRefName, pr.issueNumber?.toString() || null);
|
|
254
|
+
}
|
|
255
|
+
catch {
|
|
256
|
+
// Worktree may not exist, continue with merge
|
|
257
|
+
}
|
|
251
258
|
// Merge the PR
|
|
252
259
|
(0, child_process_1.execSync)(`gh pr merge ${pr.number} --squash --delete-branch`, {
|
|
253
260
|
cwd: projectRoot,
|
|
@@ -255,15 +262,6 @@ async function mergeCommand() {
|
|
|
255
262
|
stdio: ['pipe', 'pipe', 'pipe'],
|
|
256
263
|
});
|
|
257
264
|
prSpinner.succeed(`Merged PR #${pr.number}: ${pr.title.slice(0, 50)}`);
|
|
258
|
-
// Clean up worktree
|
|
259
|
-
const cleanSpinner = (0, ora_1.default)(` Cleaning up worktree...`).start();
|
|
260
|
-
try {
|
|
261
|
-
cleanupWorktree(projectRoot, pr.headRefName, pr.issueNumber?.toString() || null);
|
|
262
|
-
cleanSpinner.succeed(` Cleaned up worktree`);
|
|
263
|
-
}
|
|
264
|
-
catch {
|
|
265
|
-
cleanSpinner.warn(` Could not clean worktree (may not exist)`);
|
|
266
|
-
}
|
|
267
265
|
merged++;
|
|
268
266
|
}
|
|
269
267
|
catch (error) {
|