MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / parseGitStats

Function parseGitStats

evals/buffbench/pick-commits.ts:165–185  ·  view source on GitHub ↗
(statsOutput: string)

Source from the content-addressed store, hash-verified

163}
164
165function parseGitStats(statsOutput: string): {
166 filesChanged: number
167 insertions: number
168 deletions: number
169} {
170 const statsLine = statsOutput
171 .split('\n')
172 .find((line) => line.includes('files changed'))
173
174 if (!statsLine) {
175 return { filesChanged: 0, insertions: 0, deletions: 0 }
176 }
177
178 const filesChanged = parseInt(
179 statsLine.match(/(\d+) files? changed/)?.[1] || '0',
180 )
181 const insertions = parseInt(statsLine.match(/(\d+) insertions?/)?.[1] || '0')
182 const deletions = parseInt(statsLine.match(/(\d+) deletions?/)?.[1] || '0')
183
184 return { filesChanged, insertions, deletions }
185}
186
187async function generateDiffFromCommit(
188 repoPath: string,

Callers 1

getCommitsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected