Exclude symlinked folders from fuzzy finder

This can put the fuzzy finder in an infinite loop if a cycle
occurs.
This commit is contained in:
Kevin Sawicki
2013-05-13 17:33:32 -07:00
parent 5507febe09
commit f41b558fe5
2 changed files with 19 additions and 2 deletions

View File

@@ -35,9 +35,15 @@ class PathLoader
loadPath: (path) ->
@asyncCallStarting()
fs.stat path, (error, stats) =>
fs.lstat path, (error, stats) =>
unless error?
if stats.isDirectory()
if stats.isSymbolicLink()
@asyncCallStarting()
fs.stat path, (error, stats) =>
unless error?
@pathLoaded(path) if stats.isFile()
@asyncCallDone()
else if stats.isDirectory()
@loadFolder(path) unless @isIgnored(path)
else if stats.isFile()
@pathLoaded(path)

View File

@@ -71,6 +71,17 @@ describe 'FuzzyFinder', ->
runs ->
expect(finderView.list.find("li:contains(symlink-to-file)")).toExist()
it "excludes symlinked folder paths", ->
rootView.attachToDom()
finderView.maxItems = Infinity
rootView.trigger 'fuzzy-finder:toggle-file-finder'
waitsFor "all project paths to load", 5000, ->
not finderView.reloadProjectPaths
runs ->
expect(finderView.list.find("li:contains(symlink-to-dir)")).not.toExist()
describe "when root view's project has no path", ->
beforeEach ->
project.setPath(null)