Guard against empty stdout when resolving merge conflicts
Claude can exit 0 but produce no output, leaving the file blank.
This commit is contained in:
parent
b4d0d9e948
commit
fbb8680376
|
|
@ -127,7 +127,7 @@ export async function resolveConflicts(
|
||||||
"resolve this merge conflict. output ONLY the resolved file content with no markdown fences, no explanation, no surrounding text.",
|
"resolve this merge conflict. output ONLY the resolved file content with no markdown fences, no explanation, no surrounding text.",
|
||||||
)
|
)
|
||||||
|
|
||||||
if (resolved.exitCode !== 0) {
|
if (resolved.exitCode !== 0 || !resolved.stdout.trim()) {
|
||||||
const stderr = resolved.stderr.trim()
|
const stderr = resolved.stderr.trim()
|
||||||
throw new Error(`Claude failed to resolve ${file}: ${stderr || "(no output)"}`)
|
throw new Error(`Claude failed to resolve ${file}: ${stderr || "(no output)"}`)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user