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

Function parseShortstat

mods/diff/hooks/git/parse/parse-shortstat.ts:11–23  ·  view source on GitHub ↗
(stdout: string)

Source from the content-addressed store, hash-verified

9 * @returns the totals, or null
10 */
11export function parseShortstat(stdout: string): Types.DiffStats | null {
12 const counts = SHORTSTAT_PATTERN.exec(stdout)?.groups
13
14 if (!counts) {
15 return null
16 }
17
18 return {
19 filesCount: Number(counts.files),
20 linesAdded: Number(counts.added ?? 0),
21 linesRemoved: Number(counts.removed ?? 0),
22 }
23}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected