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

Faster start of RE #59

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pathspec/patterns/gitwildmatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def pattern_to_regex(

if override_regex is None:
# Build regular expression from pattern.
output = ['^']
output = []
need_slash = False
end = len(pattern_segs) - 1
for i, seg in enumerate(pattern_segs):
Expand All @@ -172,7 +172,7 @@ def pattern_to_regex(
elif i == 0:
# A normalized pattern beginning with double-asterisks
# ('**') will match any leading path segments.
output.append('(?:.+/)?')
output.append('(?:^|.+/)')
need_slash = False
elif i == end:
# A normalized pattern ending with double-asterisks ('**')
Expand Down