MCPcopy Create free account
hub / github.com/block/buzz / getDiffPath

Function getDiffPath

desktop/src/features/agents/ui/agentSessionFileEditDiff.ts:85–101  ·  view source on GitHub ↗
(text: string)

Source from the content-addressed store, hash-verified

83}
84
85function getDiffPath(text: string): string | null {
86 for (const line of text.split(/\r?\n/)) {
87 const match = line.match(/^\+\+\+\s+(?:b\/)?(.+)$/);
88 if (match?.[1] && match[1] !== "/dev/null") {
89 return match[1].trim();
90 }
91 }
92
93 for (const line of text.split(/\r?\n/)) {
94 const match = line.match(/^---\s+(?:a\/)?(.+)$/);
95 if (match?.[1] && match[1] !== "/dev/null") {
96 return match[1].trim();
97 }
98 }
99
100 return null;
101}
102
103function getDiffLines(text: string): FileEditDiffLine[] {
104 const rawLines = text.split(/\r?\n/);

Callers 1

buildFileEditDiffFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected