diff --git a/src/commands/helpers.ts b/src/commands/helpers.ts index 308dd99..fdaba79 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) } -/** Lock files to skip AI resolution — accept theirs and move on (basename match covers subdirs too). */ +/** Lock files to skip AI resolution — accept theirs and move on (basename match so `packages/foo/bun.lock` is also covered). */ const SKIP_RESOLVE = new Set(["bun.lock", "Cargo.lock"]) /** Resolve conflict markers in files using Claude, then stage them. */ diff --git a/src/git.ts b/src/git.ts index 6afb717..810146b 100644 --- a/src/git.ts +++ b/src/git.ts @@ -135,7 +135,10 @@ export async function commit(message: string, cwd: string): Promise { /** Stage a file. */ export async function stageFile(file: string, cwd: string): Promise { - await $`git add ${file}`.cwd(cwd).nothrow().quiet() + const result = await $`git add ${file}`.cwd(cwd).nothrow().quiet() + if (result.exitCode !== 0) { + throw new Error(`Failed to stage ${file}: ${result.stderr.toString().trim()}`) + } } /** Finalize a merge commit after resolving conflicts. */