Documentation
¶
Index ¶
- func DiffTrees(base, target Tree) ([]fdiff.FilePatch, error)
- func NewBillyFSGitignore(fs billy.Filesystem, commitTree *object.Tree) (billy.Filesystem, error)
- func ReadSystemGitignore() ([]gitignore.Pattern, error)
- func SortCloneSets(sets []*CloneSet)
- type Clone
- type CloneSet
- type GoGitWorktree
- type IgnoreConfig
- type IgnoreLineRule
- type IgnoreRule
- type MatcherConfigs
- type MatcherRules
- 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, commitTree *object.Tree) (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 GoGitWorktree ¶ added in v0.7.2
type GoGitWorktree struct {
// contains filtered or unexported fields
}
func NewGoGitWorkTree ¶
func NewGoGitWorkTree(repo *git.Repository) (*GoGitWorktree, error)
func (*GoGitWorktree) Reader ¶ added in v0.7.2
func (g *GoGitWorktree) Reader(path string) (io.ReadCloser, error)
func (*GoGitWorktree) String ¶ added in v0.7.2
func (g *GoGitWorktree) String() string
type IgnoreConfig ¶ added in v0.7.0
func (*IgnoreConfig) Compile ¶ added in v0.7.0
func (i *IgnoreConfig) Compile() (*IgnoreRule, 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 MatcherConfigs ¶ added in v0.10.0
type MatcherConfigs struct {
// contains filtered or unexported fields
}
func (*MatcherConfigs) Compile ¶ added in v0.10.0
func (m *MatcherConfigs) Compile() (*MatcherRules, error)
type MatcherRules ¶ added in v0.10.0
type MatcherRules struct {
// contains filtered or unexported fields
}
func ReadMatcherRules ¶ added in v0.10.0
func ReadMatcherRules(repoDir string, disableDefault bool, ignoreCLIOptions, includeCLIOptions []string) (*MatcherRules, error)
func (*MatcherRules) Match ¶ added in v0.10.0
func (m *MatcherRules) 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.