(changedFiles, repoRoot)
| 166 | } |
| 167 | |
| 168 | function 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 | |
| 181 | function isDuplicateDiff(diffHash) { |
| 182 | const state = readState(); |