MCPcopy Create free account
hub / github.com/isomorphic-git/isomorphic-git / compareStats

Function compareStats

src/utils/compareStats.js:3–17  ·  view source on GitHub ↗
(entry, stats, filemode = true, trustino = true)

Source from the content-addressed store, hash-verified

1import { normalizeStats } from './normalizeStats.js'
2
3export 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}

Callers 3

isIndexStaleFunction · 0.90
getWorkdirOidFunction · 0.90
oidMethod · 0.90

Calls 1

normalizeStatsFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…