Documentation
¶
Index ¶
- func DefaultIgnoreFunc(worktree_root fs.FS, fpath string, d fs.DirEntry, err error) error
- func FnMatch(name, pat string) (bool, error)
- func FnMatchCase(name, pat string) (bool, error)
- func GetWorkTreeRoot(start_dir string) (string, error)
- func IsRoot(fpath string) bool
- func Parent()
- func ParentDirs(fpath string) []string
- func ReverseInplace[T any](slice []T) []T
- func WalkWorktree(worktree_fs fs.FS, start_dir string, fn, fn_ignore WalkDirFunc) error
- type IgnoreCache
- type IgnorePattern
- type WalkDirFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultIgnoreFunc ¶
Skip ignored directories. Do nothing with ignored files.
func FnMatchCase ¶
func GetWorkTreeRoot ¶
func ParentDirs ¶
func ReverseInplace ¶
func ReverseInplace[T any](slice []T) []T
ReverseInplace reverses a slice in place, then returns it.
func WalkWorktree ¶
func WalkWorktree(worktree_fs fs.FS, start_dir string, fn, fn_ignore WalkDirFunc) error
Similar to `fs.WalkDir`, but calls a separate func for ignored files.
Types ¶
type IgnoreCache ¶
type IgnoreCache struct {
// contains filtered or unexported fields
}
func NewIgnoreCache ¶
func NewIgnoreCache(worktree_root fs.FS) *IgnoreCache
func (*IgnoreCache) MatchesIgnore ¶
func (ic *IgnoreCache) MatchesIgnore(fpath string, de fs.DirEntry) bool
type IgnorePattern ¶
type IgnorePattern struct { IgnoreRoot string OriginalPattern string Pattern string AsDir bool Rooted bool Negated bool }
func ParseIgnoreFile ¶
func ParseIgnoreFile(worktree_root fs.FS, ignore_file_path string) ([]IgnorePattern, error)
For gitignore matching rules ee URL: https://git-scm.com/docs/gitignore
Click to show internal directories.
Click to hide internal directories.