Add comment explaining why clearActivity is called before process.exit

process.exit(1) skips the finally block, so cleanup must happen
explicitly in the catch block.
This commit is contained in:
Chris Wanstrath 2026-04-10 10:06:00 -07:00
parent 101651b107
commit a7285a4347

View File

@ -188,7 +188,7 @@ export async function mergeAndClose(branch: string, opts?: { squash?: boolean; f
} catch (err) {
const message = err instanceof Error ? err.message : String(err)
spin.fail(message)
if (session) await vm.clearActivity(session.worktree, branch)
if (session) await vm.clearActivity(session.worktree, branch) // process.exit below skips finally
await git.abortMerge(root)
process.exit(1)
} finally {