cloner

package
v0.0.0-...-ec59030 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2026 License: MIT Imports: 14 Imported by: 0

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

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 IsGitRepo

func IsGitRepo(path string) bool

IsGitRepo checks whether the given path contains a .git directory.

func IsMissingRepo

func IsMissingRepo(path string) bool

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) Fail

func (p *BatchProgress) Fail()

Fail marks an item as failed.

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

type FailureRecord struct {
	Name  string
	Error string
}

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

func NewProgress(total int, quiet bool) *Progress

NewProgress creates a progress tracker.

func (*Progress) Begin

func (p *Progress) Begin(name string)

Begin prints the starting line for a repo.

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.

Jump to

Keyboard shortcuts

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