MCPcopy Create free account
hub / github.com/bearlyai/OpenADE / truncatePatch

Function truncatePatch

projects/electron/src/modules/code/git.ts:891–897  ·  view source on GitHub ↗

* Truncate patch if too large, add warning message

(patch: string, maxSize: number = MAX_PATCH_SIZE)

Source from the content-addressed store, hash-verified

889 * Truncate patch if too large, add warning message
890 */
891function 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
899function countHunks(patch: string): number {
900 let count = 0

Callers 2

handleWorkTreeDiffPatchFunction · 0.85
handleGetGitStatusFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected