* Truncate patch if too large, add warning message
(patch: string, maxSize: number = MAX_PATCH_SIZE)
| 889 | * Truncate patch if too large, add warning message |
| 890 | */ |
| 891 | function truncatePatch(patch: string, maxSize: number = MAX_PATCH_SIZE): { patch: string; truncated: boolean } { |
| 892 | if (patch.length <= maxSize) { |
| 893 | return { patch, truncated: false } |
| 894 | } |
| 895 | const truncatedPatch = patch.slice(0, maxSize) + "\n\n... [PATCH TRUNCATED - too large to display] ..." |
| 896 | return { patch: truncatedPatch, truncated: true } |
| 897 | } |
| 898 | |
| 899 | function countHunks(patch: string): number { |
| 900 | let count = 0 |
no outgoing calls
no test coverage detected