Skip to content
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