You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
GitIgnoreSpec misses anchored rules for redundant interior path separators #176
GitIgnoreSpec misses an anchored ignore rule when a relative path contains a doubled slash or an interior ./ component. Git matches all three spellings of the same file. This can make a caller report an ignored file as unignored when its relative path was assembled by concatenation.
Tested with pathspec 1.1.1 at current master 47ea6a5b02bc, Python 3.14.8 and Git 2.55.0 on Windows.
For comparison, in a Git repository with an existing data/private.txt and .gitignore containing /data/private.txt, git check-ignore -v --no-index data/private.txt data//private.txt data/./private.txt reports that same rule for all three arguments. The alternate spellings also resolve to the same file on disk.
Expected
All three paths match the anchored ignore rule, as they do in Git.
Cause and related work
normalize_file() normalizes separator characters and a leading ./, but retains redundant interior separators and ./ components. Related PR #173 addresses repeated leading./ prefixes; I checked its current head and these two interior cases still miss the rule.
Activity