mirror of
https://github.com/atom/atom.git
synced 2026-01-23 05:48:10 -05:00
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:
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user