Documentation
¶
Index ¶
- func ParseGitStatus(output string) []model.DirtyFile
- type Decision
- type Engine
- type ExecGitRunner
- func (g *ExecGitRunner) Checkout(repoDir, branch string) error
- func (g *ExecGitRunner) Clone(url, dest string) error
- func (g *ExecGitRunner) CurrentBranch(repoDir string) (string, error)
- func (g *ExecGitRunner) DiffStats(repoDir string) (int, int, error)
- func (g *ExecGitRunner) Fetch(repoDir string) error
- func (g *ExecGitRunner) IsDirty(repoDir string) (bool, []model.DirtyFile, error)
- func (g *ExecGitRunner) PullFF(repoDir string) (bool, error)
- func (g *ExecGitRunner) RemoteURL(repoDir string) (string, error)
- func (g *ExecGitRunner) SubmoduleUpdate(repoDir string) error
- type GitRunner
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseGitStatus ¶
ParseGitStatus parses git status --porcelain output into DirtyFile entries. This is a pure function for testability.
Types ¶
type Engine ¶
Engine orchestrates per-repo sync operations.
func (*Engine) CloneRepo ¶
func (e *Engine) CloneRepo(repo model.RepoInfo) model.RepoResult
CloneRepo clones a missing repository.
func (*Engine) ProcessRepo ¶
func (e *Engine) ProcessRepo(repo model.RepoInfo) model.RepoResult
ProcessRepo audits and syncs an existing local repository.
type ExecGitRunner ¶
type ExecGitRunner struct{}
ExecGitRunner runs real git commands.
func (*ExecGitRunner) Checkout ¶
func (g *ExecGitRunner) Checkout(repoDir, branch string) error
func (*ExecGitRunner) Clone ¶
func (g *ExecGitRunner) Clone(url, dest string) error
func (*ExecGitRunner) CurrentBranch ¶
func (g *ExecGitRunner) CurrentBranch(repoDir string) (string, error)
func (*ExecGitRunner) DiffStats ¶
func (g *ExecGitRunner) DiffStats(repoDir string) (int, int, error)
func (*ExecGitRunner) Fetch ¶
func (g *ExecGitRunner) Fetch(repoDir string) error
func (*ExecGitRunner) SubmoduleUpdate ¶
func (g *ExecGitRunner) SubmoduleUpdate(repoDir string) error
type GitRunner ¶
type GitRunner interface {
Clone(url, dest string) error
Fetch(repoDir string) error
SubmoduleUpdate(repoDir string) error
CurrentBranch(repoDir string) (string, error)
IsDirty(repoDir string) (bool, []model.DirtyFile, error)
DiffStats(repoDir string) (int, int, error) // additions, deletions
Checkout(repoDir, branch string) error
PullFF(repoDir string) (bool, error) // returns true if changes were pulled
RemoteURL(repoDir string) (string, error)
}
GitRunner executes git commands. Abstracted for testability.
Click to show internal directories.
Click to hide internal directories.