Skip AI conflict resolution for lock files
Lock files like bun.lock and Cargo.lock contain auto-generated content that Claude cannot meaningfully merge. Remove them during conflict resolution so they get regenerated cleanly.
This commit is contained in:
parent
6175d753f0
commit
1143bf08c9
|
|
@ -81,6 +81,9 @@ export async function teardownSession(root: string, branch: string, worktree: st
|
||||||
await state.removeSession(root, branch)
|
await state.removeSession(root, branch)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Files that should be resolved by accepting "theirs" instead of using Claude. */
|
||||||
|
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. */
|
||||||
export async function resolveConflicts(
|
export async function resolveConflicts(
|
||||||
files: string[],
|
files: string[],
|
||||||
|
|
@ -90,6 +93,12 @@ export async function resolveConflicts(
|
||||||
for (let i = 0; i < files.length; i++) {
|
for (let i = 0; i < files.length; i++) {
|
||||||
const file = files[i]
|
const file = files[i]
|
||||||
onFile(file, i + 1, files.length)
|
onFile(file, i + 1, files.length)
|
||||||
|
|
||||||
|
if (SKIP_RESOLVE.has(basename(file))) {
|
||||||
|
await $`git rm -f -- ${file}`.cwd(cwd).nothrow().quiet()
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
const content = await Bun.file(join(cwd, file)).text()
|
const content = await Bun.file(join(cwd, file)).text()
|
||||||
|
|
||||||
const resolved = await vm.claudePipe(
|
const resolved = await vm.claudePipe(
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user