From e694ab06d77716c78fa6223954ca4f6140f9176b Mon Sep 17 00:00:00 2001 From: Chris Wanstrath Date: Tue, 7 Apr 2026 17:55:40 -0700 Subject: [PATCH] Accept theirs for conflicting lock files instead of deleting them Removing lock files during conflict resolution caused missing dependencies after the merge. Checking out theirs and staging preserves a valid lockfile. --- src/commands/helpers.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/commands/helpers.ts b/src/commands/helpers.ts index 6872fe3..308dd99 100644 --- a/src/commands/helpers.ts +++ b/src/commands/helpers.ts @@ -81,7 +81,7 @@ export async function teardownSession(root: string, branch: string, worktree: st await state.removeSession(root, branch) } -/** Files that should be removed rather than resolved — they get regenerated. */ +/** Lock files to skip AI resolution — accept theirs and move on (basename match covers subdirs too). */ const SKIP_RESOLVE = new Set(["bun.lock", "Cargo.lock"]) /** Resolve conflict markers in files using Claude, then stage them. */ @@ -95,7 +95,11 @@ export async function resolveConflicts( onFile(file, i + 1, files.length) if (SKIP_RESOLVE.has(basename(file))) { - await $`git rm -f -- ${file}`.cwd(cwd).nothrow().quiet() + const result = await $`git checkout --theirs -- ${file}`.cwd(cwd).nothrow().quiet() + if (result.exitCode !== 0) { + throw new Error(`Failed to resolve lock file ${file}: ${result.stderr.toString().trim()}`) + } + await git.stageFile(file, cwd) continue }