Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove realpathCache argument in fs.realpath #1269

Merged
merged 2 commits into from Jul 6, 2018
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.
+4 −5
Diff settings

Always

Just for now

@@ -5,7 +5,6 @@ const fs = require('fs-plus')
const PathWatcher = require('pathwatcher')
const File = require('./file')
const {repoForPath} = require('./helpers')
const realpathCache = {}

module.exports =
class Directory {
@@ -116,7 +115,7 @@ class Directory {
this.lowerCaseRealPath = this.realPath.toLowerCase()
}
} else {
fs.realpath(this.path, realpathCache, (error, realPath) => {
fs.realpath(this.path, (error, realPath) => {
// FIXME: Add actual error handling
if (error || this.destroyed) return
if (realPath && (realPath !== this.path)) {
@@ -320,7 +319,7 @@ class Directory {
// track the insertion index for the created views
files.push(name)
} else {
files.push(new File({name, fullPath, symlink, realpathCache, ignoredNames: this.ignoredNames, useSyncFS: this.useSyncFS, stats: statFlat}))
files.push(new File({name, fullPath, symlink, ignoredNames: this.ignoredNames, useSyncFS: this.useSyncFS, stats: statFlat}))
}
}
}
@@ -4,7 +4,7 @@ const {repoForPath} = require('./helpers')

module.exports =
class File {
constructor ({name, fullPath, symlink, realpathCache, ignoredNames, useSyncFS, stats}) {
constructor ({name, fullPath, symlink, ignoredNames, useSyncFS, stats}) {
this.name = name
this.symlink = symlink
this.ignoredNames = ignoredNames
@@ -22,7 +22,7 @@ class File {
if (useSyncFS) {
this.realPath = fs.realpathSync(this.path)
} else {
fs.realpath(this.path, realpathCache, (error, realPath) => {
fs.realpath(this.path, (error, realPath) => {
// FIXME: Add actual error handling
if (error || this.destroyed) return
if (realPath && realPath !== this.path) {
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.