MCPcopy Create free account
hub / github.com/EvoMap/evolver / getGitDiff

Function getGitDiff

src/gep/selfPR.js:271–293  ·  view source on GitHub ↗
(changedFiles, repoRoot)

Source from the content-addressed store, hash-verified

269}
270
271function getGitDiff(changedFiles, repoRoot) {
272 const parts = [];
273 for (const f of changedFiles) {
274 const before = parts.length;
275 try {
276 const result = execSync(
277 'git diff HEAD -- "' + f + '"',
278 { cwd: repoRoot, timeout: 10000, encoding: 'utf8', stdio: ['pipe', 'pipe', 'pipe'], maxBuffer: MAX_EXEC_BUFFER }
279 );
280 if (result && result.trim()) parts.push(result.trim());
281 } catch (_) {}
282 if (parts.length === before) {
283 try {
284 const result = execSync(
285 'git diff -- "' + f + '"',
286 { cwd: repoRoot, timeout: 10000, encoding: 'utf8', stdio: ['pipe', 'pipe', 'pipe'], maxBuffer: MAX_EXEC_BUFFER }
287 );
288 if (result && result.trim()) parts.push(result.trim());
289 } catch (_) {}
290 }
291 }
292 return parts.join('\n');
293}
294
295async function maybeCreatePR({ capsule, event, mutation, gene, blastRadius }) {
296 if (String(process.env.EVOLVER_SELF_PR || '').toLowerCase() !== 'true') return null;

Callers 1

maybeCreatePRFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected