(entry, stats, filemode = true, trustino = true)
| 1 | import { normalizeStats } from './normalizeStats.js' |
| 2 | |
| 3 | export function compareStats(entry, stats, filemode = true, trustino = true) { |
| 4 | // Comparison based on the description in Paragraph 4 of |
| 5 | // https://www.kernel.org/pub/software/scm/git/docs/technical/racy-git.txt |
| 6 | const e = normalizeStats(entry) |
| 7 | const s = normalizeStats(stats) |
| 8 | const staleness = |
| 9 | (filemode && e.mode !== s.mode) || |
| 10 | e.mtimeSeconds !== s.mtimeSeconds || |
| 11 | e.ctimeSeconds !== s.ctimeSeconds || |
| 12 | e.uid !== s.uid || |
| 13 | e.gid !== s.gid || |
| 14 | (trustino && e.ino !== s.ino) || |
| 15 | e.size !== s.size |
| 16 | return staleness |
| 17 | } |
no test coverage detected
searching dependent graphs…