git

package
v0.0.35 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 31, 2026 License: MIT Imports: 10 Imported by: 0

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

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

func (s *Source) Changed(ctx context.Context, base string) (map[string]bool, error)

Changed returns the paths changed since the merge base with base plus the untracked files; an unresolvable base is CodeNotFound.

func (*Source) List

func (s *Source) List(ctx context.Context) ([]types.File, error)

List returns the tracked files present on disk and the untracked, non-ignored files, sorted.

func (*Source) ListIgnored added in v0.0.27

func (s *Source) ListIgnored(ctx context.Context, scope []string) ([]types.File, error)

ListIgnored returns the untracked files git ignores under scope (the whole tree when scope is empty), sorted.

func (*Source) Read

func (s *Source) Read(_ context.Context, p string) ([]byte, error)

Read reads one file from the working tree.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL