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 include logic where include path is subdirectory of excluded path. #302

Merged
merged 2 commits into from Jan 19, 2022

Conversation

shendy-a8c
Copy link
Contributor

@shendy-a8c shendy-a8c commented Jan 17, 2022

Fixes #172.

Changes in this PR:

  • Fix containsMatchingChildren(), so $root_relative_path doesn't have trailing slash. [#]. This is because $include and $exclude are trailing-slash-trimmed, so if $root_relative_path isn't, this clause won't be true as expected.
  • When the file iterator gets to the included folder, which is a subfolder of an excluded folder, it will get here, so I created a new if block to handle that case.
  • Unit test for this case: including a folder inside an excluded folder.

@shendy-a8c shendy-a8c requested a review from a team as a code owner January 17, 2022 11:05
@shendy-a8c shendy-a8c mentioned this pull request Jan 17, 2022
2 tasks
@swissspidy
Copy link
Member

Thanks a lot for this PR!

No yoda condition.

Co-authored-by: Pascal Birchler <pascal.birchler@gmail.com>
@shendy-a8c
Copy link
Contributor Author

@swissspidy I'm not rushing but just want to make sure if there is any action item on my side.

@swissspidy swissspidy merged commit fdc6e15 into wp-cli:main Jan 19, 2022
@schlessera schlessera added this to the 2.2.14 milestone Apr 6, 2022
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.

Vendor folder ignored
3 participants