Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[Finder] Adjust regex to correctly match comments in gitignore contents#33340
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Jeroeny commentedSep 16, 2019
Ready to merge or is more review needed? |
| [ | ||
| ' | ||
| /app/cache/ | ||
| \#EscapedComment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
What about using a real file name to check that it will be in the list (#file.txt like in a test above)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
That'd indeed be more useful, I'll change it.
Uh oh!
There was an error while loading.Please reload this page.
33b2695 toe56fc7cComparefabpot commentedSep 16, 2019
Thank you@Jeroeny. |
…nore contents (Jeroeny)This PR was squashed before being merged into the 4.3 branch (closes#33340).Discussion----------[Finder] Adjust regex to correctly match comments in gitignore contents| Q | A| ------------- | ---| Branch? | 4.3| Bug fix? | yes| New feature? | no| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets |#32985| License | MITDescription from issue:When using `ignoreVCSIgnored` as argument with the Symfony Finder, it will construct a regex equivalent of the gitignore pattern. However it seems that when a comment line (prefixed with `#`) is present in the `.gitignore`, the regex used to remove comment lines matches every line and thus returns `$gitignoreFileContent` as empty.Commits-------e56fc7c [Finder] Adjust regex to correctly match comments in gitignore contents
Description from issue:
When using
ignoreVCSIgnoredas argument with the Symfony Finder, it will construct a regex equivalent of the gitignore pattern. However it seems that when a comment line (prefixed with#) is present in the.gitignore, the regex used to remove comment lines matches every line and thus returns$gitignoreFileContentas empty.