Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Ignore VCS directories even when they are not in ignoreNames #399

Merged
merged 2 commits into from Jun 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions lib/load-paths-handler.js
Expand Up @@ -68,6 +68,11 @@ class PathLoader {
args.push('-g', '!' + ignoredName.pattern)
}

if (this.ignoreVcsIgnores) {
if (!args.includes('!.git')) args.push('-g', '!.git')
if (!args.includes('!.hg')) args.push('-g', '!.hg')
}

let output = ''
const result = childProcess.spawn(realRgPath, args, {cwd: this.rootPath})

Expand Down
15 changes: 15 additions & 0 deletions spec/fuzzy-finder-spec.js
Expand Up @@ -1670,6 +1670,21 @@ describe('FuzzyFinder', () => {
expect(Array.from(projectView.element.querySelectorAll('li')).find(a => a.textContent.includes('file.txt'))).toBeDefined()
})
})

describe('when core.ignoredNames does not have .git in its glob patterns', () => {
beforeEach(() => {
atom.config.set('core.ignoredNames', [])
})

it('still ignores .git directory', async () => {
await projectView.toggle()

await waitForPathsToDisplay(projectView)

expect(Array.from(projectView.element.querySelectorAll('li')).find(a =>
a.textContent.includes('HEAD'))).not.toBeDefined()
})
})
})

describe('when core.excludeVcsIgnoredPaths is set to false', () => {
Expand Down