Documentation
¶
Index ¶
- Constants
- Variables
- func LogFailure(ctx context.Context, logger *slog.Logger, root string, err error)
- type BaseList
- type BaseRef
- type BaseSource
- type Contents
- type Engine
- type FileChange
- type GitEngine
- func (e *GitEngine) Bases(ctx context.Context, root projectfiles.Root, q string, limit int) (BaseList, error)
- func (e *GitEngine) Contents(ctx context.Context, root projectfiles.Root, req Request, t PatchTarget) (Contents, error)
- func (e *GitEngine) Patches(ctx context.Context, root projectfiles.Root, req Request, ...) ([]Patch, error)
- func (e *GitEngine) Summary(ctx context.Context, root projectfiles.Root, req Request) (Summary, error)
- type Option
- type Patch
- type PatchTarget
- type Request
- type Scope
- type Side
- type Status
- type Summary
- type Totals
Constants ¶
View Source
const ( FileLimit = 3000 PatchLimit = 1 << 20 )
Variables ¶
View Source
var ( ErrNotARepository = errors.New("changes: not a git repository") ErrBaseNotFound = errors.New("changes: base ref not found") ErrStale = errors.New("changes: working tree changed since revision") ErrTooLargeToExpand = errors.New("changes: file too large to expand") ErrInvalidScope = errors.New("changes: invalid scope") ErrTooManyPaths = errors.New("changes: patch batch exceeds limits") )
Functions ¶
Types ¶
type BaseRef ¶
type BaseRef struct {
Ref, Kind string
IsDefault bool
Source BaseSource
}
type BaseSource ¶
type BaseSource string
type Engine ¶
type Engine interface {
Summary(context.Context, projectfiles.Root, Request) (Summary, error)
Patches(context.Context, projectfiles.Root, Request, []PatchTarget) ([]Patch, error)
Contents(context.Context, projectfiles.Root, Request, PatchTarget) (Contents, error)
Bases(context.Context, projectfiles.Root, string, int) (BaseList, error)
}
type FileChange ¶
type GitEngine ¶
type GitEngine struct {
// contains filtered or unexported fields
}
func (*GitEngine) Contents ¶
func (e *GitEngine) Contents( ctx context.Context, root projectfiles.Root, req Request, t PatchTarget, ) (Contents, error)
type Option ¶
type Option func(*GitEngine)
func WithGitRunner ¶
func WithGitRunner(runner worktree.StreamingGitRunner) Option
func WithReader ¶
func WithReader(reader projectfiles.Reader) Option
type PatchTarget ¶
type PatchTarget struct{ Path, OldPath string }
type Summary ¶
type Summary struct {
Scope Scope
HeadBranch, HeadSHA, BaseRef string
BaseSource BaseSource
MergeBaseSHA string
Files []FileChange
Totals Totals
Truncated bool
Revision string
}
Click to show internal directories.
Click to hide internal directories.