Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for handling .gitignore edge cases in GitIgnorePattern. #8

Merged
merged 1 commit into from
May 16, 2015

Commits on May 16, 2015

  1. Fixes for handling .gitignore edge cases in GitIgnorePattern.

    The git client (tested with v2.4.1) exhibits differing behavior than
    pathspec's GitIgnorePattern, including:
    
    - `/` does NOT match all paths the repo
    - `/abs/path` matches: `abs/path/foo`
    - `spam` matches: `spam/`, `spam/foo`
    - `spam/two` does NOT match: `foo/spam/two`
    - `spam/**` does NOT match: `foo/spam/bar`
    - `left/**/right` does NOT match: `foo/left/bar/right`
    - `**/spam` does match: `foo/spam/`, `foo/spam/bar`
    - `foo-*-bar` does match: `foo-hello-bar/baz`
    - `~temp-*` does match: `~temp-foo/bar`
    - `*.py` does match: `bar.py/baz`
    
    Tests for each of these cases have been added. While some of these edge
    cases may be bugs in git, until they are fixed, I believe that pathspec
    should handle .gitignore files as close as possible to how git handles
    them.
    
    More complex behavior, such as an include pattern followed by an exclude
    pattern were not tested since they would involve integration tests.
    mikexstudios committed May 16, 2015
    Configuration menu
    Copy the full SHA
    ec6ceb4 View commit details
    Browse the repository at this point in the history