Documentation
¶
Overview ¶
internal/status/git.go
internal/status/numstat.go
internal/status/porcelain.go
internal/status/reader.go
Index ¶
- type GitReader
- func (r *GitReader) Fetch(ctx context.Context, repoPath string) (*model.RepoStatus, error)
- func (r *GitReader) FetchBatch(ctx context.Context, paths []string) (map[string]*model.RepoStatus, map[string]error)
- func (r *GitReader) GetDiffStats(ctx context.Context, repoPath string) *model.DiffStats
- func (r *GitReader) GetDiffStatsBatch(ctx context.Context, paths []string) map[string]*model.DiffStats
- func (r *GitReader) GetStatus(ctx context.Context, repoPath string) (*model.RepoStatus, error)
- func (r *GitReader) GetStatusBatch(ctx context.Context, paths []string) (map[string]*model.RepoStatus, map[string]error)
- func (r *GitReader) GetStatusFromOutput(ctx context.Context, repoPath string, porcelainOutput string) (*model.RepoStatus, error)
- func (r *GitReader) RunAlias(ctx context.Context, repoPath string, cmd string) (string, error)
- type Reader
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GitReader ¶
type GitReader struct {
// contains filtered or unexported fields
}
func NewGitReader ¶
func NewGitReader() *GitReader
func (*GitReader) Fetch ¶
Fetch runs git fetch and returns updated status. Returns the fetch error (if any) alongside the current status so callers can distinguish "fetch failed but here's the old status" from "status read failed".
func (*GitReader) FetchBatch ¶
func (*GitReader) GetDiffStats ¶
GetDiffStats reads line-level diff stats, commit activity, and file churn for a repo. All 4 git commands run in parallel with independent timeouts. Always returns a result (possibly with partial data) — never returns an error since all sub-commands are non-fatal.
func (*GitReader) GetDiffStatsBatch ¶
func (*GitReader) GetStatusBatch ¶
func (*GitReader) GetStatusFromOutput ¶
func (r *GitReader) GetStatusFromOutput(ctx context.Context, repoPath string, porcelainOutput string) (*model.RepoStatus, error)
GetStatusFromOutput builds a full RepoStatus from pre-fetched porcelain output, running supplementary commands (stash, log, remote) in parallel.
type Reader ¶
type Reader interface {
GetStatus(ctx context.Context, repoPath string) (*model.RepoStatus, error)
GetStatusFromOutput(ctx context.Context, repoPath string, porcelainOutput string) (*model.RepoStatus, error)
GetStatusBatch(ctx context.Context, paths []string) (map[string]*model.RepoStatus, map[string]error)
// Fetch returns the fetch error alongside the status so callers can
// distinguish "fetch failed but here's the old status" from "status read failed".
Fetch(ctx context.Context, repoPath string) (*model.RepoStatus, error)
FetchBatch(ctx context.Context, paths []string) (map[string]*model.RepoStatus, map[string]error)
// GetDiffStats always returns a result (possibly partial) — never nil.
GetDiffStats(ctx context.Context, repoPath string) *model.DiffStats
GetDiffStatsBatch(ctx context.Context, paths []string) map[string]*model.DiffStats
RunAlias(ctx context.Context, repoPath string, cmd string) (string, error)
}