From 374454f0fb0713d93627fc5cc9c714d8dd2eeab3 Mon Sep 17 00:00:00 2001 From: Chris Wanstrath Date: Fri, 10 Apr 2026 08:44:17 -0700 Subject: [PATCH] Add missing lockfiles to skip list and show fallback for empty stderr Several ecosystem lockfiles (Nix flake, Gradle, npm-shrinkwrap, Swift PM) were missing from SKIP_RESOLVE, causing unnecessary conflict resolution attempts. Empty stderr on failure produced confusing error messages. --- src/commands/helpers.ts | 7 ++++++- src/git.ts | 6 ++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/commands/helpers.ts b/src/commands/helpers.ts index e114f46..af8262c 100644 --- a/src/commands/helpers.ts +++ b/src/commands/helpers.ts @@ -96,6 +96,10 @@ const SKIP_RESOLVE = new Set([ "Podfile.lock", "poetry.lock", "pubspec.lock", + "flake.lock", + "gradle.lockfile", + "npm-shrinkwrap.json", + "Package.resolved", "uv.lock", "yarn.lock", ]) @@ -124,7 +128,8 @@ export async function resolveConflicts( ) if (resolved.exitCode !== 0) { - throw new Error(`Claude failed to resolve ${file}: ${resolved.stderr.toString().trim()}`) + const stderr = resolved.stderr.toString().trim() + throw new Error(`Claude failed to resolve ${file}: ${stderr || "(no output)"}`) } await Bun.write(join(cwd, file), resolved.stdout.trimEnd() + "\n") diff --git a/src/git.ts b/src/git.ts index 3f55b02..de40efc 100644 --- a/src/git.ts +++ b/src/git.ts @@ -137,7 +137,8 @@ export async function commit(message: string, cwd: string): Promise { export async function checkoutTheirs(file: string, cwd: string): Promise { const result = await $`git checkout --theirs -- ${file}`.cwd(cwd).nothrow().quiet() if (result.exitCode !== 0) { - throw new Error(`Failed to checkout theirs for ${file}: ${result.stderr.toString().trim()}`) + const stderr = result.stderr.toString().trim() + throw new Error(`Failed to checkout theirs for ${file}: ${stderr || "(no output)"}`) } } @@ -145,7 +146,8 @@ export async function checkoutTheirs(file: string, cwd: string): Promise { export async function stageFile(file: string, cwd: string): Promise { 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()}`) + const stderr = result.stderr.toString().trim() + throw new Error(`Failed to stage ${file}: ${stderr || "(no output)"}`) } }