Documentation
¶
Overview ¶
Package git is the git working-tree CodebaseSource: the files git tracks plus the untracked files it does not ignore, read from disk, with Changed answered by `git diff --merge-base`. A directory that is not a repository has no files.
Index ¶
- type Source
- func (s *Source) Changed(ctx context.Context, base string) (map[string]bool, error)
- func (s *Source) List(ctx context.Context) ([]types.File, error)
- func (s *Source) ListIgnored(ctx context.Context, scope []string) ([]types.File, error)
- func (s *Source) Read(_ context.Context, p string) ([]byte, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Source ¶
type Source struct {
// contains filtered or unexported fields
}
Source serves a git working tree through git's own file list.
func New ¶
func New(root string, runner interfaces.CommandRunner) *Source
New returns a Source for the working tree at root, running git through runner. It does no I/O.
func (*Source) Changed ¶
Changed returns the paths changed since the merge base with base plus the untracked files; an unresolvable base is CodeNotFound.
func (*Source) List ¶
List returns the tracked files present on disk and the untracked, non-ignored files, sorted.
func (*Source) ListIgnored ¶ added in v0.0.27
ListIgnored returns the untracked files git ignores under scope (the whole tree when scope is empty), sorted.