This commit is contained in:
Kevin Sawicki
2013-02-02 17:04:33 -08:00
parent 94f1630152
commit 6e4cb9874a
2 changed files with 7 additions and 8 deletions

View File

@@ -3,14 +3,13 @@ _ = require 'underscore'
Git = require 'git'
module.exports =
loadPaths: (rootPath, ignoredNames, ignoreGitIgnoredFiles) ->
loadPaths: (rootPath, ignoredNames, excludeGitIgnoredPaths) ->
paths = []
repo = Git.open(rootPath, refreshIndexOnFocus: false) if ignoreGitIgnoredFiles
repo = Git.open(rootPath, refreshIndexOnFocus: false) if excludeGitIgnoredPaths
isIgnored = (path) ->
for segment in path.split('/')
return true if _.contains(ignoredNames, segment)
return true if repo?.isPathIgnored(fs.join(rootPath, path))
false
repo?.isPathIgnored(fs.join(rootPath, path))
onFile = (path) ->
paths.push(path) unless isIgnored(path)
onDirectory = (path) ->

View File

@@ -6,11 +6,11 @@ class LoadPathsTask extends Task
super('fuzzy-finder/src/load-paths-handler')
started: ->
ignoredNames = config.get("fuzzyFinder.ignoredNames") ? []
ignoredNames = ignoredNames.concat(config.get("core.ignoredNames") ? [])
ignoreGitIgnoredFiles = config.get("core.hideGitIgnoredFiles")
ignoredNames = config.get('fuzzyFinder.ignoredNames') ? []
ignoredNames = ignoredNames.concat(config.get('core.ignoredNames') ? [])
excludeGitIgnoredPaths = config.get('core.hideGitIgnoredFiles')
rootPath = @rootView.project.getPath()
@callWorkerMethod('loadPaths', rootPath, ignoredNames, ignoreGitIgnoredFiles)
@callWorkerMethod('loadPaths', rootPath, ignoredNames, excludeGitIgnoredPaths)
pathsLoaded: (paths) ->
@terminate()