MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / parseShortstat

Function parseShortstat

source code/utils/gitDiff.ts:373–384  ·  view source on GitHub ↗
(stdout: string)

Source from the content-addressed store, hash-verified

371 * loading all content. Used as a quick probe before expensive operations.
372 */
373export function parseShortstat(stdout: string): GitDiffStats | null {
374 // Match: "N files changed" with optional ", N insertions(+)" and ", N deletions(-)"
375 const match = stdout.match(
376 /(\d+)\s+files?\s+changed(?:,\s+(\d+)\s+insertions?\(\+\))?(?:,\s+(\d+)\s+deletions?\(-\))?/,
377 )
378 if (!match) return null
379 return {
380 filesCount: parseInt(match[1] ?? '0', 10),
381 linesAdded: parseInt(match[2] ?? '0', 10),
382 linesRemoved: parseInt(match[3] ?? '0', 10),
383 }
384}
385
386const SINGLE_FILE_DIFF_TIMEOUT_MS = 3000
387

Callers 1

fetchGitDiffFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected