Documentation
¶
Index ¶
- Variables
- func AcquireCloneLock(dir string) func()
- func CloneIfRequired(ctx context.Context, refName plumbing.ReferenceName, ...) (*git.Repository, error)
- func FindGitRef(ctx context.Context, file string) (string, error)
- func FindGitRevision(ctx context.Context, file string) (shortSha, sha string, err error)
- func FindGithubRepo(ctx context.Context, file, githubInstance, remoteName string) (string, error)
- func NewGitCloneExecutor(input NewGitCloneExecutorInput) common.Executor
- type Error
- type NewGitCloneExecutorInput
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrShortRef = errors.New("short SHA references are not supported") ErrNoRepo = errors.New("unable to find git repo") )
Functions ¶
func AcquireCloneLock ¶ added in v1.0.2
func AcquireCloneLock(dir string) func()
AcquireCloneLock returns an unlock function after locking the per-directory mutex for dir. Only concurrent operations targeting the same directory are serialized; clones into different directories run in parallel. Callers reading files inside dir (e.g. tarring a checked-out action into a job container) must hold this lock too, otherwise a concurrent NewGitCloneExecutor on the same dir can mutate the worktree mid-read.
func CloneIfRequired ¶
func CloneIfRequired(ctx context.Context, refName plumbing.ReferenceName, input NewGitCloneExecutorInput, logger log.FieldLogger) (*git.Repository, error)
CloneIfRequired ...
func FindGitRef ¶
FindGitRef get the current git ref
func FindGitRevision ¶
FindGitRevision get the current git revision
func FindGithubRepo ¶
FindGithubRepo get the repo
func NewGitCloneExecutor ¶
func NewGitCloneExecutor(input NewGitCloneExecutorInput) common.Executor
NewGitCloneExecutor creates an executor to clone git repos
Types ¶
Click to show internal directories.
Click to hide internal directories.