Documentation
¶
Overview ¶
Package gitignore provides gitignore pattern matching functionality. It supports parsing .gitignore files and matching paths against patterns.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Matcher ¶
type Matcher struct {
// contains filtered or unexported fields
}
Matcher matches paths against gitignore patterns.
func NewMatcher ¶
NewMatcher creates a Matcher by loading all .gitignore files from root up to each subdirectory. The root parameter should be the project root directory.
func (*Matcher) LoadNestedGitignore ¶
LoadNestedGitignore loads a .gitignore file from a subdirectory. The relDir is the relative path from root to the directory containing .gitignore.
func (*Matcher) Match ¶
Match checks if a path should be ignored. The path should be relative to the matcher's root. isDir indicates whether the path is a directory.
func (*Matcher) ShouldTraverse ¶
ShouldTraverse checks if a directory should be traversed. This is an optimization to skip entire directory trees.