@brimveyn/aimux 1.16.0 → 1.16.1
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/package.json
CHANGED
|
@@ -1610,7 +1610,6 @@ async function runDeleteWorktree(
|
|
|
1610
1610
|
if (tabsInWorktree.length > 0 && !force && !closeTabs) {
|
|
1611
1611
|
throw new ActiveWorktreeTabsError(tabsInWorktree.length)
|
|
1612
1612
|
}
|
|
1613
|
-
disposeWorktreeTabs(ctx, worktreeId)
|
|
1614
1613
|
|
|
1615
1614
|
const repoPath = resolveWorktreeGitDir(session, worktree)
|
|
1616
1615
|
const isAimuxTemp = worktree.source === 'aimux-temp' && worktree.createdByAimux
|
|
@@ -1624,15 +1623,14 @@ async function runDeleteWorktree(
|
|
|
1624
1623
|
}
|
|
1625
1624
|
}
|
|
1626
1625
|
|
|
1626
|
+
// Run git ops FIRST. If any throws (dirty worktree, etc.) the catch in the
|
|
1627
|
+
// delete-worktree side effect handler re-prompts force or toasts the error —
|
|
1628
|
+
// tabs stay open and the row stays in the sidebar, so the UI matches reality
|
|
1629
|
+
// instead of leaving tabs closed against a worktree that still exists.
|
|
1627
1630
|
if (isAimuxTemp && isInsideAimuxWorktreeRoot(worktree.path) && !existsSync(worktree.path)) {
|
|
1628
1631
|
// The dir vanished but git may still pin the branch to a stale worktree entry.
|
|
1629
1632
|
await pruneGitWorktrees(repoPath)
|
|
1630
|
-
|
|
1631
|
-
removeWorktreeRecordFromSession(ctx, sessionId, session, worktreeId)
|
|
1632
|
-
return
|
|
1633
|
-
}
|
|
1634
|
-
|
|
1635
|
-
if (isAimuxTemp && isInsideAimuxWorktreeRoot(worktree.path)) {
|
|
1633
|
+
} else if (isAimuxTemp && isInsideAimuxWorktreeRoot(worktree.path)) {
|
|
1636
1634
|
await assertSafeAimuxWorktreePath(worktree.path)
|
|
1637
1635
|
await removeGitWorktree({ force, repoPath, targetPath: worktree.path })
|
|
1638
1636
|
} else if (worktree.source === 'aimux-temp' || worktree.createdByAimux) {
|
|
@@ -1640,7 +1638,15 @@ async function runDeleteWorktree(
|
|
|
1640
1638
|
}
|
|
1641
1639
|
|
|
1642
1640
|
await cleanupAimuxBranch()
|
|
1643
|
-
|
|
1641
|
+
|
|
1642
|
+
// Only after git success: close tabs + retire the record. Re-read state so
|
|
1643
|
+
// we don't operate on the snapshot captured before the awaits above.
|
|
1644
|
+
disposeWorktreeTabs({ ...ctx, state: ctx.getState() }, worktreeId)
|
|
1645
|
+
const latest = ctx.getState()
|
|
1646
|
+
const latestSession = latest.sessions.find((entry) => entry.id === sessionId)
|
|
1647
|
+
if (latestSession) {
|
|
1648
|
+
removeWorktreeRecordFromSession({ ...ctx, state: latest }, sessionId, latestSession, worktreeId)
|
|
1649
|
+
}
|
|
1644
1650
|
}
|
|
1645
1651
|
|
|
1646
1652
|
// A worktree's stored repoRoot can point at a sibling worktree that was since
|