Skip to content

Commit 05417a3

Browse files
committed
Normalize parsed diff path sentinels
1 parent 1498add commit 05417a3

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

src/CodexToolCallMapper.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -488,14 +488,17 @@ function joinPatchLines(lines: string[]): string {
488488
return lines.join("\n");
489489
}
490490

491-
function normalizeDiffPath(fileName: string | undefined): string | undefined {
492-
if (!fileName || fileName === "/dev/null") {
491+
function normalizeDiffPath(fileName: string | undefined): string | null {
492+
if (!fileName) {
493+
return null;
494+
}
495+
if (fileName === "/dev/null") {
493496
return fileName;
494497
}
495498
return fileName.replace(/^[ab]\//, "");
496499
}
497500

498-
function toPatchChangeKind(oldFileName: string | undefined, newFileName: string | undefined): FileUpdateChange["kind"] {
501+
function toPatchChangeKind(oldFileName: string | null, newFileName: string | null): FileUpdateChange["kind"] {
499502
if (oldFileName === "/dev/null") {
500503
return { type: "add" };
501504
}

0 commit comments

Comments
 (0)