One function
fnmatch_pathname_to_regex in mherrmann/gitignore_parser
The author described this change as “Fix pattern with slash in range (#55)”. It counts as a record because the check below fails on the code as it stood at ffbfd79ab and passes on d45a08589, with nothing else changed between the two runs.
Projectmherrmann/gitignore_parser
Fix saved2023-10-03
Sharing licenceMIT · LICENSE
Change size+1 −1
What the code was meant to do, written into the code itself as a docstring
Implements fnmatch style-behavior, as though with FNM_PATHNAME flagged; the path separator will not match shell-style '*' and '.' wildcards.
The change
| 44 | 44 | if j >= n: | |
| 45 | 45 | res.append('\\[') | |
| 46 | 46 | else: | |
| 47 | - | stuff = pattern[i:j].replace('\\', '\\\\') | |
| 47 | + | stuff = pattern[i:j].replace('\\', '\\\\').replace('/', '') | |
| 48 | 48 | i = j + 1 | |
| 49 | 49 | if stuff[0] == '!': | |
| 50 | 50 | stuff = ''.join(['^', stuff[1:]]) |
The check that tells the two apart
fail→pass·tests.py::Test::test_slash_in_range_does_not_match_dirs
Check file tests.py, taken without changes from the fix and copied onto the older code, so the exact same check runs against both versions.
Origin and history
The code before itffbfd79ab4b96f88cd78322a91b6809ba8d97173
Broken version dated2023-08-15
Modulegitignore_parser
Units changedfnmatch_pathname_to_regex
Fingerprint4492b68b920e0e12
Checked2026-08-18 by goldset/0.1
Every field above is generated by our program. None of it is written by hand.
Other bugs found in mherrmann/gitignore_parser
- 2024-01-19Fix ValueError for some symlinks
- 2023-10-05Fix: do not resolve symlinks
- 2023-10-04rule_from_pattern
- 2023-10-04fnmatch_pathname_to_regex
- 2023-10-03rule_from_pattern
- 2023-06-30fnmatch_pathname_to_regex