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

Function fetchGitDiffHunks

source code/utils/gitDiff.ts:116–137  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

114 * Separated from fetchGitDiff() to avoid expensive calls during polling.
115 */
116export async function fetchGitDiffHunks(): Promise<
117 Map<string, StructuredPatchHunk[]>
118> {
119 const isGit = await getIsGit()
120 if (!isGit) return new Map()
121
122 if (await isInTransientGitState()) {
123 return new Map()
124 }
125
126 const { stdout: diffOut, code: diffCode } = await execFileNoThrow(
127 gitExe(),
128 ['--no-optional-locks', 'diff', 'HEAD'],
129 { timeout: GIT_TIMEOUT_MS, preserveOutputOnError: false },
130 )
131
132 if (diffCode !== 0) {
133 return new Map()
134 }
135
136 return parseGitDiff(diffOut)
137}
138
139export type NumstatResult = {
140 stats: GitDiffStats

Callers 1

loadDiffDataFunction · 0.85

Calls 3

isInTransientGitStateFunction · 0.85
execFileNoThrowFunction · 0.85
parseGitDiffFunction · 0.85

Tested by

no test coverage detected