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

Function computeDiffHash

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

Source from the content-addressed store, hash-verified

166}
167
168function computeDiffHash(changedFiles, repoRoot) {
169 const diffParts = [];
170 for (const f of changedFiles) {
171 const abs = path.join(repoRoot, f);
172 try {
173 if (fs.existsSync(abs)) {
174 diffParts.push(f + ':' + fs.readFileSync(abs, 'utf8'));
175 }
176 } catch (_) {}
177 }
178 return crypto.createHash('sha256').update(diffParts.join('\n---\n')).digest('hex').slice(0, 16);
179}
180
181function isDuplicateDiff(diffHash) {
182 const state = readState();

Callers 1

maybeCreatePRFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected