mirror of
https://github.com/atom/atom.git
synced 2026-01-22 21:38:10 -05:00
Exclude core.ignoredNames when scanning project
This commit is contained in:
@@ -320,6 +320,22 @@ describe "Project", ->
|
||||
expect(paths[0]).toBe filePath
|
||||
expect(matches.length).toBe 1
|
||||
|
||||
it "excludes values in core.ignoredNames", ->
|
||||
projectPath = '/tmp/atom-tests/folder-with-dot-git/.git'
|
||||
filePath = fsUtils.join(projectPath, 'test.txt')
|
||||
fsUtils.write(filePath, 'match this')
|
||||
project.setPath(projectPath)
|
||||
paths = []
|
||||
matches = []
|
||||
waitsForPromise ->
|
||||
project.scan /match/, ({path, match, range}) ->
|
||||
paths.push(path)
|
||||
matches.push(match)
|
||||
|
||||
runs ->
|
||||
expect(paths.length).toBe 0
|
||||
expect(matches.length).toBe 0
|
||||
|
||||
describe "serialization", ->
|
||||
it "restores the project path", ->
|
||||
newProject = Project.deserialize(project.serialize())
|
||||
|
||||
@@ -276,6 +276,8 @@ class Project
|
||||
|
||||
command = require.resolve('nak')
|
||||
args = ['--hidden', '--ackmate', regex.source, @getPath()]
|
||||
ignoredNames = config.get('core.ignoredNames') ? []
|
||||
args.unshift('--ignore', ignoredNames.join(',')) if ignoredNames.length > 0
|
||||
args.unshift("--addVCSIgnores") if config.get('core.excludeVcsIgnoredPaths')
|
||||
new BufferedProcess({command, args, stdout, exit})
|
||||
deferred
|
||||
|
||||
Reference in New Issue
Block a user