Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReadPatterns ¶
func ReadPatterns(searchPath SearchPath, inputTree *InputTreeNode, accumulator []gitignore.Pattern, lastRelation Relation) ([]gitignore.Pattern, error)
ReadPatterns reads gitignore patterns recursively traversing through the directory structure. The result is in the ascending order of priority (last higher). This function has been modified to respect gitignore patterns while it's traversing. This has a big impact for larger repositories.
Types ¶
type InputTreeNode ¶
type InputTreeNode struct {
Children map[string]*InputTreeNode
}
func NewInputTree ¶
func NewInputTree(paths []string) *InputTreeNode
func NewInputTreeNode ¶
func NewInputTreeNode(splitPath []string) *InputTreeNode
func (*InputTreeNode) AddChild ¶
func (t *InputTreeNode) AddChild(splitPath []string)
func (*InputTreeNode) Relation ¶
func (t *InputTreeNode) Relation(splitPath []string) Relation
type RepoFinder ¶
type RepoFinder struct {
// contains filtered or unexported fields
}
RepoFinder finds the git repository for a given directory.
func NewRepoFinder ¶
func NewRepoFinder(inputPaths []string) *RepoFinder
NewRepoFinder returns a new RepoFinder instance
func (*RepoFinder) FindRepo ¶
func (s *RepoFinder) FindRepo(path string) Repo
FindRepo takes a directory path and finds the git repository for it if one exists. It works by searching within the given directory, followed by searching in parent directories until it either reaches the top-level directory or encounters an error.
type SearchPath ¶
type SearchPath struct {
// contains filtered or unexported fields
}
func NewSearchPath ¶
func NewSearchPath(prefix string, path []string) SearchPath
func (SearchPath) Abs ¶
func (s SearchPath) Abs() string
func (SearchPath) AbsSplit ¶
func (s SearchPath) AbsSplit() []string
func (SearchPath) Path ¶
func (s SearchPath) Path() []string
func (SearchPath) WithAddedPath ¶
func (s SearchPath) WithAddedPath(path string) SearchPath
Click to show internal directories.
Click to hide internal directories.