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.
This commit is contained in:
parent
29cbf29b76
commit
e694ab06d7
|
|
@ -81,7 +81,7 @@ export async function teardownSession(root: string, branch: string, worktree: st
|
||||||
await state.removeSession(root, branch)
|
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"])
|
const SKIP_RESOLVE = new Set(["bun.lock", "Cargo.lock"])
|
||||||
|
|
||||||
/** Resolve conflict markers in files using Claude, then stage them. */
|
/** Resolve conflict markers in files using Claude, then stage them. */
|
||||||
|
|
@ -95,7 +95,11 @@ export async function resolveConflicts(
|
||||||
onFile(file, i + 1, files.length)
|
onFile(file, i + 1, files.length)
|
||||||
|
|
||||||
if (SKIP_RESOLVE.has(basename(file))) {
|
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
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user