Skip to content

Keep gitignore bracket expressions within path segments - #163

Open
xingzhao-ji wants to merge 1 commit into
cpburnz:masterfrom
xingzhao-ji:fix/bracket-directory-separator
Open

xingzhao-ji wants to merge 1 commit into
cpburnz:masterfrom
xingzhao-ji:fix/bracket-directory-separator

Conversation

@xingzhao-ji

Copy link
Copy Markdown

GitIgnoreSpec.from_lines(['a[!x]b']).match_file('a/b') currently returns True, unlike Git. Ranges spanning / and the POSIX punct, graph, and print classes have the same problem. Exclude / while translating these brackets so matches stay within a path segment.
The regression produces 117 failing subtests before the fix and passes afterward. The full three-backend suite runs 270 tests with one skip. Each selected Git-oracle backend run has zero mismatches across 155,448 comparisons; spec APIs use that backend, while byte-pattern APIs use Python regex in every run. Unusual mixed range/POSIX forms retain their existing behavior.

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