MCPcopy Index your code
hub / github.com/21st-dev/1code / applyNumstatToFiles

Function applyNumstatToFiles

src/main/lib/git/utils/apply-numstat.ts:5–24  ·  view source on GitHub ↗
(
	git: SimpleGit,
	files: ChangedFile[],
	diffArgs: string[],
)

Source from the content-addressed store, hash-verified

3import { parseDiffNumstat } from "./parse-status";
4
5export async function applyNumstatToFiles(
6 git: SimpleGit,
7 files: ChangedFile[],
8 diffArgs: string[],
9): Promise<void> {
10 if (files.length === 0) return;
11
12 try {
13 const numstat = await git.raw(diffArgs);
14 const stats = parseDiffNumstat(numstat);
15
16 for (const file of files) {
17 const fileStat = stats.get(file.path);
18 if (fileStat) {
19 file.additions = fileStat.additions;
20 file.deletions = fileStat.deletions;
21 }
22 }
23 } catch {}
24}

Callers 2

createStatusRouterFunction · 0.90
getBranchComparisonFunction · 0.90

Calls 2

parseDiffNumstatFunction · 0.90
getMethod · 0.45

Tested by

no test coverage detected