Crate gitignore [] [src]

Support for loading, parsing and matching paths against the rules in a .gitignore file.

This create has been specifically crafted to have no dependencies on Git itself - all you need is a directory with a `.gitignore file in it, and a path you want to check is excluded by some rule in the file.

All of the patterns described in the man page for the .gitignore format, (specifically, in the "Pattern Format" section) are implemented. This crate currently does not support auto-loading patterns from $GIT_DIR/info/exclude or from the file specified by the Git configuration variable core.excludesFile (the user excludes file); rather, it will only load patterns specified in the .gitignore file in the given directory.

Structs

Error

Encapsulates all the types of errors this crate can produce.

File

Represents a .gitignore file. Use this to load the .gitignore file, parse the patterns, and then check if a given path would be excluded by any rules contained therein.

Pattern

A pattern as found in a .gitignore file.