Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ignore): ignore patterns which base path includes in source pattern base path #118

Merged
merged 1 commit into from
Oct 2, 2018

Conversation

DudaGod
Copy link
Contributor

@DudaGod DudaGod commented Oct 1, 2018

What is the purpose of this pull request?

Fix bug related to incorrect ignoring patterns.

Example:

var fg = require('fast-glob');
fg('fixtures/first/**/*.md', {ignore: ['fixtures/**/*.md']}).then(console.log)

Get result:

[ 'fixtures/first/file.md',
  'fixtures/first/nested/file.md',
  'fixtures/first/nested/directory/file.md' ]

Expected result:

[]

What changes did you make? (Give an overview)

I fixed method findLocalNegativePatterns which should not only check that base path of ignore pattern includes base path of source pattern but also vice versa.

@mrmlnc mrmlnc self-assigned this Oct 2, 2018
@mrmlnc mrmlnc merged commit 0b2d461 into mrmlnc:master Oct 2, 2018
@mrmlnc
Copy link
Owner

mrmlnc commented Oct 2, 2018

Thanks for your work 🌮

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants