Improve merge spinner messages and conflict resolution flow

This commit is contained in:
Chris Wanstrath 2026-02-23 19:20:37 -08:00
parent ec1f6796b8
commit 1022a75722

View File

@ -52,20 +52,23 @@ export async function mergeAndClose(branch: string, opts?: { squash?: boolean })
} }
const label = opts?.squash ? "Squash-merged" : "Merged" const label = opts?.squash ? "Squash-merged" : "Merged"
const spin = spinner("Merging", branch)
const conflicts = await git.merge(branch, root, opts?.squash ? { squash: true } : undefined) const conflicts = await git.merge(branch, root, opts?.squash ? { squash: true } : undefined)
if (conflicts.length === 0) { if (conflicts.length === 0) {
if (opts?.squash) { if (opts?.squash) {
spin.text = "Starting container"
await vm.ensure((msg) => { spin.text = msg })
spin.text = "Generating commit message"
await squashCommit(branch, root) await squashCommit(branch, root)
} }
console.log(`${label} ${branch} into current branch`) spin.succeed(`${label} ${branch} into current branch`)
await closeAction(branch) await closeAction(branch)
return return
} }
// Resolve conflicts with Claude // Resolve conflicts with Claude
console.log(`◆ Merge conflicts in ${conflicts.length} file(s). Resolving with Claude...`) spin.text = `Resolving ${conflicts.length} conflict(s)`
const spin = spinner("Starting container", branch)
try { try {
await vm.ensure((msg) => { spin.text = msg }) await vm.ensure((msg) => { spin.text = msg })