mirror of
https://github.com/Kilo-Org/kilocode.git
synced 2026-09-01 15:32:11 +08:00
fix(cli): give DiffFull.detail a single return shape
The binary branch returned an object without before/after while the normal branch included them, so the result was a union and callers could not read before/after without narrowing (the diff-full test failed typecheck). Return before/after as undefined for binary files so the shape is uniform; JSON still omits the undefined keys, so serialized output is unchanged.
This commit is contained in:
@@ -126,7 +126,9 @@ export namespace DiffFull {
|
||||
deletions: Number.isFinite(deletions) ? deletions : 0,
|
||||
status,
|
||||
}
|
||||
if (binary) return base
|
||||
// Uniform shape across branches: binary files carry no content, but keep the keys present
|
||||
// (undefined) so the return type is a single object, not a union missing before/after.
|
||||
if (binary) return { ...base, before: undefined, after: undefined }
|
||||
|
||||
const content = yield* Effect.all(
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user