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 lack of implicit anchoring of patterns to directory separators #58

Merged

Conversation

jherland
Copy link
Contributor

@jherland jherland commented Oct 4, 2023

This proposes a different fix to issue #10 than what is currently in
PR #11. Not sure which solution is more correct/preferable.

Commits:

  • Fix DeprecationWarning: invalid escape sequence '\/'
  • Fix lack of implicit anchoring of patterns to directory separators

A pattern without "*" - like "o.py" - carries an implicit assumption
(not clearly documented in https://git-scm.com/docs/gitignore) that it
should match a complete directory entry, and not freely match within
an entry's name, i.e. it should match "o.py", but not "foo.py" or
"o.pyc".

To accomplish this, ensure that the pattern only matches at the start
of the path, or directly following a directory separator.
@mherrmann mherrmann merged commit cdf80b7 into mherrmann:master Oct 4, 2023
5 checks passed
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.

2 participants