Skip to content

Keep gitignore bracket expressions within path segments - #163

Merged
cpburnz merged 1 commit into
cpburnz:masterfrom
xingzhao-ji:fix/bracket-directory-separator
Oct 18, 2026
Merged

cpburnz merged 1 commit into
cpburnz:masterfrom
xingzhao-ji:fix/bracket-directory-separator

Conversation

@xingzhao-ji

Copy link
Copy Markdown
Contributor

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.

@cpburnz
cpburnz merged commit e51866f into cpburnz:master Oct 18, 2026
7 checks passed
@cpburnz

cpburnz commented Oct 18, 2026

Copy link
Copy Markdown
Owner

Thanks for finding and fixing this.

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.

2 participants