Skip to content

Commit

Permalink
Fix logic error in stats comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
mbargiel committed Jun 1, 2019
1 parent c879654 commit bea4a39
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/util/stat.js
Expand Up @@ -155,15 +155,14 @@ function checkParentPathsSync (src, srcStat, dest, funcName) {

function areApparentlyIdentical (srcStat, destStat) {
if (destStat.ino && destStat.dev && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev) {
if (nodeSupportsBigInt()) {
if (nodeSupportsBigInt() || destStat.ino < Number.MAX_SAFE_INTEGER) {
// definitive answer
return true
}
// Use additional heuristics if we can't use 'bigint'.
// Different 'ino' could be represented the same if they are >= Number.MAX_SAFE_INTEGER
// Different 'ino' could be represented the same if they are >= Number.MAX_SAFE_INTEGER
// See issue 657
if (destStat.ino >= Number.MAX_SAFE_INTEGER &&
destStat.size === srcStat.size &&
if (destStat.size === srcStat.size &&
destStat.mode === srcStat.mode &&
destStat.nlink === srcStat.nlink &&
destStat.atimeMs === srcStat.atimeMs &&
Expand Down

0 comments on commit bea4a39

Please sign in to comment.