mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Respect core.excludeVcsIgnoredPaths in fuzzy finder
This commit is contained in:
@@ -11,8 +11,8 @@ class PathLoader
|
||||
rootPath: null
|
||||
ignoredNames: null
|
||||
|
||||
constructor: (@rootPath, @ignoredNames) ->
|
||||
@repo = Git.open(@rootPath)
|
||||
constructor: (@rootPath, ignoreVcsIgnores=false, @ignoredNames=[]) ->
|
||||
@repo = Git.open(@rootPath, refreshOnWindowFocus: false) if ignoreVcsIgnores
|
||||
@ignoredNames.sort()
|
||||
|
||||
isIgnored: (loadedPath) ->
|
||||
@@ -23,7 +23,7 @@ class PathLoader
|
||||
|
||||
asyncCallDone: ->
|
||||
if --@asyncCallsInProgress is 0
|
||||
@repo?.release()
|
||||
@repo?.destroy()
|
||||
callTaskMethod('pathsLoaded', @paths)
|
||||
callTaskMethod('pathLoadingComplete')
|
||||
|
||||
@@ -53,6 +53,6 @@ class PathLoader
|
||||
@loadFolder(@rootPath)
|
||||
|
||||
module.exports =
|
||||
loadPaths: (rootPath, ignoredNames) ->
|
||||
pathLoader = new PathLoader(rootPath, ignoredNames)
|
||||
loadPaths: (rootPath, ignoreVcsIgnores, ignoredNames) ->
|
||||
pathLoader = new PathLoader(rootPath, ignoreVcsIgnores, ignoredNames)
|
||||
pathLoader.load()
|
||||
|
||||
@@ -9,7 +9,8 @@ class LoadPathsTask extends Task
|
||||
@paths = []
|
||||
ignoredNames = config.get('fuzzyFinder.ignoredNames') ? []
|
||||
ignoredNames = ignoredNames.concat(config.get('core.ignoredNames') ? [])
|
||||
@callWorkerMethod('loadPaths', project.getPath(), ignoredNames)
|
||||
ignoreVcsIgnores = config.get('core.excludeVcsIgnoredPaths')
|
||||
@callWorkerMethod('loadPaths', project.getPath(), ignoreVcsIgnores, ignoredNames)
|
||||
|
||||
pathsLoaded: (paths) ->
|
||||
@paths.push(paths...)
|
||||
|
||||
@@ -353,6 +353,27 @@ describe 'FuzzyFinder', ->
|
||||
runs ->
|
||||
expect(finderView.list.find("li:contains(tree-view.js)")).not.toExist()
|
||||
|
||||
describe "when core.excludeVcsIgnoredPaths is set to true", ->
|
||||
ignoreFile = null
|
||||
|
||||
beforeEach ->
|
||||
ignoreFile = fsUtils.join(project.getPath(), '.gitignore')
|
||||
fsUtils.write(ignoreFile, 'sample.js')
|
||||
config.set("core.excludeVcsIgnoredPaths", true)
|
||||
|
||||
afterEach ->
|
||||
fsUtils.remove(ignoreFile) if fsUtils.exists(ignoreFile)
|
||||
|
||||
it "ignores paths that are git ignored", ->
|
||||
rootView.trigger 'fuzzy-finder:toggle-file-finder'
|
||||
finderView.maxItems = Infinity
|
||||
|
||||
waitsFor ->
|
||||
finderView.list.children('li').length > 0
|
||||
|
||||
runs ->
|
||||
expect(finderView.list.find("li:contains(sample.js)")).not.toExist()
|
||||
|
||||
describe "fuzzy find by content under cursor", ->
|
||||
editor = null
|
||||
|
||||
|
||||
Reference in New Issue
Block a user