Documentation
¶
Index ¶
- func DiffTrees(base, target Tree) ([]fdiff.FilePatch, error)
- func NewBillyFSGitignore(fs billy.Filesystem) (billy.Filesystem, error)
- func ReadSystemGitignore() ([]gitignore.Pattern, error)
- func SortCloneSets(sets []*CloneSet)
- type Clone
- type CloneSet
- type IgnoreConfig
- type IgnoreConfigs
- type IgnoreLineRule
- type IgnoreRule
- type IgnoreRules
- type Searcher
- type SearcherFile
- type Source
- type Tree
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DiffTrees ¶
DiffTrees calculates diffs between two trees.
Diff implementations is referred from go-git's (*git.Worktree).Status() method.
func NewBillyFSGitignore ¶ added in v0.7.1
func NewBillyFSGitignore(fs billy.Filesystem) (billy.Filesystem, error)
func ReadSystemGitignore ¶ added in v0.7.1
func SortCloneSets ¶
func SortCloneSets(sets []*CloneSet)
Types ¶
type Clone ¶
type CloneSet ¶
func (*CloneSet) ChangedProportion ¶
type IgnoreConfig ¶ added in v0.7.0
func (*IgnoreConfig) Compile ¶ added in v0.7.0
func (i *IgnoreConfig) Compile() (*IgnoreRule, error)
type IgnoreConfigs ¶ added in v0.7.0
type IgnoreConfigs []*IgnoreConfig
func (IgnoreConfigs) Compile ¶ added in v0.7.0
func (i IgnoreConfigs) Compile() (IgnoreRules, error)
type IgnoreLineRule ¶ added in v0.7.0
type IgnoreLineRule struct {
IgnoreLines map[int]struct{}
// contains filtered or unexported fields
}
func (*IgnoreLineRule) CanSkip ¶ added in v0.7.0
func (l *IgnoreLineRule) CanSkip(startLine int, windowSize int) (canSkip bool, skipUntil int)
CanSkip determines if window size starting from startLine can be skipped.
Caller expectations:
- Callers are expected to monotonically increase startLine.
- Next call to CanSkip() starts from skipUntil+1, if canSkip is true.
type IgnoreRule ¶ added in v0.7.0
type IgnoreRule struct {
// contains filtered or unexported fields
}
type IgnoreRules ¶ added in v0.7.0
type IgnoreRules []*IgnoreRule
func ReadIgnoreRules ¶ added in v0.7.0
func ReadIgnoreRules(repoDir string, cliOptions []string, disableDefault bool) (IgnoreRules, error)
func (IgnoreRules) Match ¶ added in v0.7.0
func (i IgnoreRules) Match(path string, contents []byte) (skipEntireFile bool, ignoreRule *IgnoreLineRule)
Match checks the file and its contents to ignore. If skipEntireFile is true, callers are expected to skip this entire file (ignoreRule is nil). Otherwise, callers are expected to call IgnoreLineRule.CanSkip() method according to its doc to check file ignore pattern.
type Searcher ¶
type Searcher interface {
Files() ([]string, error)
Open(name string) (SearcherFile, error)
}
Searcher is an interface for use with clone search backend implementations.
func NewSearcherFromTree ¶
type SearcherFile ¶
type Tree ¶
type Tree interface {
// String should return a short human-readable representation of this tree.
String() string
// Tree MAY return concrete go-git tree implementation, for use with direct comparison from the other tree
// and with the go-git embedded rename detection function.
//
// If Tree() returns false, comparison will fallback to Noder() diffing.
Tree() (t *object.Tree, err error, ok bool)
// Noder returns noder.Noder for diffing changes from the other noder.Noder instance.
Noder() (noder.Noder, error)
// Reader returns io.ReadCloser to the file contents.
Reader(path string) (io.ReadCloser, error)
}
Tree represents a tree-like filesystem with various backends. Tree interface is used for comparison between two filesystem snapshots without depending on a specific backend implementation.