Documentation
¶
Overview ¶
Package cloner re-clones repos from structured files.
Package cloner — pulldiag.go provides pull diagnosis and file-lock remediation.
Package cloner re-clones repos from structured files.
Index ¶
- func CloneFromFile(sourcePath, targetDir string, safePull bool) (model.CloneSummary, error)
- func CloneFromFileQuiet(sourcePath, targetDir string, safePull bool) (model.CloneSummary, error)
- func IsGitRepo(path string) bool
- func IsMissingRepo(path string) bool
- func SafePullOne(rec model.ScanRecord, repoDir string) model.CloneResult
- type BatchProgress
- func (p *BatchProgress) BeginItem(name string)
- func (p *BatchProgress) ExitCodeForBatch() int
- func (p *BatchProgress) Fail()
- func (p *BatchProgress) FailWithError(name, errMsg string)
- func (p *BatchProgress) Failed() int
- func (p *BatchProgress) Failures() []FailureRecord
- func (p *BatchProgress) HasFailures() bool
- func (p *BatchProgress) PrintFailureReport()
- func (p *BatchProgress) PrintSummary()
- func (p *BatchProgress) SetStopOnFail(v bool)
- func (p *BatchProgress) Skip()
- func (p *BatchProgress) Skipped() int
- func (p *BatchProgress) Stopped() bool
- func (p *BatchProgress) Succeed()
- func (p *BatchProgress) Succeeded() int
- type FailureRecord
- type Progress
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CloneFromFile ¶
func CloneFromFile(sourcePath, targetDir string, safePull bool) (model.CloneSummary, error)
CloneFromFile reads a source file and clones all repos under targetDir.
func CloneFromFileQuiet ¶
func CloneFromFileQuiet(sourcePath, targetDir string, safePull bool) (model.CloneSummary, error)
CloneFromFileQuiet reads a source file and clones with suppressed progress.
func IsMissingRepo ¶
IsMissingRepo returns true when the path is not a valid git repository.
func SafePullOne ¶
func SafePullOne(rec model.ScanRecord, repoDir string) model.CloneResult
SafePullOne runs safe-pull on a single repo. Exported for use by the pull command.
Types ¶
type BatchProgress ¶
type BatchProgress struct {
// contains filtered or unexported fields
}
BatchProgress tracks progress for any batch operation (pull, exec, status).
func NewBatchProgress ¶
func NewBatchProgress(total int, operation string, quiet bool) *BatchProgress
NewBatchProgress creates a progress tracker for a named operation.
func (*BatchProgress) BeginItem ¶
func (p *BatchProgress) BeginItem(name string)
BeginItem prints progress for starting an item.
func (*BatchProgress) ExitCodeForBatch ¶
func (p *BatchProgress) ExitCodeForBatch() int
ExitCodeForBatch returns 0 if all items succeeded, or the partial-failure exit code if any items failed. Use with os.Exit() in the calling command.
func (*BatchProgress) FailWithError ¶
func (p *BatchProgress) FailWithError(name, errMsg string)
FailWithError marks an item as failed and records the error detail.
func (*BatchProgress) Failed ¶
func (p *BatchProgress) Failed() int
Failed returns the failure count.
func (*BatchProgress) Failures ¶
func (p *BatchProgress) Failures() []FailureRecord
Failures returns all recorded failure details.
func (*BatchProgress) HasFailures ¶
func (p *BatchProgress) HasFailures() bool
HasFailures returns true if any items failed.
func (*BatchProgress) PrintFailureReport ¶
func (p *BatchProgress) PrintFailureReport()
PrintFailureReport outputs a detailed list of failed items after a batch operation. Call after PrintSummary when HasFailures() is true.
func (*BatchProgress) PrintSummary ¶
func (p *BatchProgress) PrintSummary()
PrintSummary prints the final summary.
func (*BatchProgress) SetStopOnFail ¶
func (p *BatchProgress) SetStopOnFail(v bool)
SetStopOnFail enables early termination after the first failure.
func (*BatchProgress) Skip ¶
func (p *BatchProgress) Skip()
Skip marks an item as skipped (e.g., missing directory).
func (*BatchProgress) Skipped ¶
func (p *BatchProgress) Skipped() int
Skipped returns the skip count.
func (*BatchProgress) Stopped ¶
func (p *BatchProgress) Stopped() bool
Stopped returns true if the batch was halted due to --stop-on-fail.
func (*BatchProgress) Succeed ¶
func (p *BatchProgress) Succeed()
Succeed marks an item as successful.
func (*BatchProgress) Succeeded ¶
func (p *BatchProgress) Succeeded() int
Succeeded returns the success count.
type FailureRecord ¶
FailureRecord stores details about a single failed batch item.
type Progress ¶
type Progress struct {
// contains filtered or unexported fields
}
Progress tracks clone operation progress.
func NewProgress ¶
NewProgress creates a progress tracker.
func (*Progress) Done ¶
func (p *Progress) Done(result model.CloneResult, pulled bool)
Done marks a repo as successfully completed.
func (*Progress) Fail ¶
func (p *Progress) Fail(result model.CloneResult)
Fail marks a repo as failed.
func (*Progress) PrintSummary ¶
func (p *Progress) PrintSummary()
PrintSummary prints the final summary line.