Skip to content

Strip repeated ./ prefixes before matching paths - #173

Open
Luxe7 wants to merge 2 commits into
cpburnz:masterfrom
Luxe7:fix/repeated-dot-prefixes
Open

Luxe7 wants to merge 2 commits into
cpburnz:masterfrom
Luxe7:fix/repeated-dot-prefixes

Conversation

@Luxe7

@Luxe7 Luxe7 commented Oct 28, 2026

Copy link
Copy Markdown

normalize_file() removes only one leading ./, so /build/ matches ./build/output.txt but misses ././build/output.txt. git check-ignore matches both paths.

Strip all consecutive leading ./ components while leaving .. and the rest of the path alone. Added regression tests for custom separators and for single-file and batch matching with both PathSpec and GitIgnoreSpec.

python -m unittest discover -t . -s tests/ passes with the default backend and with RE2 installed. Hyperscan tests are skipped because that optional backend is not installed.

This branch has not been deployed

No deployments
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.

1 participant