Skip to content

Commit

Permalink
Rename areApparentlyIdentical to areIdentical
Browse files Browse the repository at this point in the history
  • Loading branch information
mbargiel committed Jul 26, 2019
1 parent bea4a39 commit 7e4c852
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/util/stat.js
Expand Up @@ -78,7 +78,7 @@ function checkPaths (src, dest, funcName, cb) {
getStats(src, dest, (err, stats) => {
if (err) return cb(err)
const { srcStat, destStat } = stats
if (destStat && areApparentlyIdentical(srcStat, destStat)) {
if (destStat && areIdentical(srcStat, destStat)) {
return cb(new Error('Source and destination must not be the same.'))
}
if (srcStat.isDirectory() && isSrcSubdir(src, dest)) {
Expand All @@ -90,7 +90,7 @@ function checkPaths (src, dest, funcName, cb) {

function checkPathsSync (src, dest, funcName) {
const { srcStat, destStat } = getStatsSync(src, dest)
if (destStat && areApparentlyIdentical(srcStat, destStat)) {
if (destStat && areIdentical(srcStat, destStat)) {
throw new Error('Source and destination must not be the same.')
}
if (srcStat.isDirectory() && isSrcSubdir(src, dest)) {
Expand All @@ -113,7 +113,7 @@ function checkParentPaths (src, srcStat, dest, funcName, cb) {
if (err.code === 'ENOENT') return cb()
return cb(err)
}
if (areApparentlyIdentical(srcStat, destStat)) {
if (areIdentical(srcStat, destStat)) {
return cb(new Error(errMsg(src, dest, funcName)))
}
return checkParentPaths(src, srcStat, destParent, funcName, cb)
Expand All @@ -124,7 +124,7 @@ function checkParentPaths (src, srcStat, dest, funcName, cb) {
if (err.code === 'ENOENT') return cb()
return cb(err)
}
if (areApparentlyIdentical(srcStat, destStat)) {
if (areIdentical(srcStat, destStat)) {
return cb(new Error(errMsg(src, dest, funcName)))
}
return checkParentPaths(src, srcStat, destParent, funcName, cb)
Expand All @@ -147,13 +147,13 @@ function checkParentPathsSync (src, srcStat, dest, funcName) {
if (err.code === 'ENOENT') return
throw err
}
if (areApparentlyIdentical(srcStat, destStat)) {
if (areIdentical(srcStat, destStat)) {
throw new Error(errMsg(src, dest, funcName))
}
return checkParentPathsSync(src, srcStat, destParent, funcName)
}

function areApparentlyIdentical (srcStat, destStat) {
function areIdentical (srcStat, destStat) {
if (destStat.ino && destStat.dev && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev) {
if (nodeSupportsBigInt() || destStat.ino < Number.MAX_SAFE_INTEGER) {
// definitive answer
Expand Down

0 comments on commit 7e4c852

Please sign in to comment.