(patch: Git.Patch)
| 86 | } |
| 87 | |
| 88 | const splitGitPatch = (patch: Git.Patch) => { |
| 89 | const starts = [...patch.text.matchAll(/(?:^|\n)diff --git /g)].map((match) => |
| 90 | match[0].startsWith("\n") ? match.index + 1 : match.index, |
| 91 | ) |
| 92 | const chunks = starts.map((start, index) => patch.text.slice(start, starts[index + 1] ?? patch.text.length)) |
| 93 | if (!patch.truncated) return chunks |
| 94 | return chunks.slice(0, -1) |
| 95 | } |
| 96 | |
| 97 | const batchPatches = Effect.fnUntraced(function* ( |
| 98 | git: Git.Interface, |