git

package
v1.2.3-0...-0b8789f Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2025 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

nolint: forbidigo

Index

Constants

View Source
const CommitHashNotSet = "-"

Variables

This section is empty.

Functions

func Available

func Available() bool

Types

type LocalRepository

type LocalRepository struct {
	// contains filtered or unexported fields
}

func (LocalRepository) CommitHash

func (v LocalRepository) CommitHash() string

func (LocalRepository) Definition

func (v LocalRepository) Definition() model.TemplateRepository

func (LocalRepository) Free

func (v LocalRepository) Free() <-chan struct{}

func (LocalRepository) Fs

func (LocalRepository) String

func (v LocalRepository) String() string

type PullResult

type PullResult struct {
	OldHash string
	NewHash string
	Changed bool
}

type RemoteRepository

type RemoteRepository struct {
	// contains filtered or unexported fields
}

func Checkout

func Checkout(ctx context.Context, ref model.TemplateRepository, sparse bool, logger log.Logger) (r *RemoteRepository, err error)

func (*RemoteRepository) CommitHash

func (r *RemoteRepository) CommitHash() string

func (*RemoteRepository) Definition

func (r *RemoteRepository) Definition() model.TemplateRepository

func (*RemoteRepository) Free

func (r *RemoteRepository) Free() <-chan struct{}

func (*RemoteRepository) Fs

Fs return repository filesystem.

func (*RemoteRepository) Load

func (r *RemoteRepository) Load(ctx context.Context, path string) error

Load a path from the remote git repository, if sparse mode is used.

func (*RemoteRepository) Pull

func (r *RemoteRepository) Pull(ctx context.Context) (*PullResult, error)

func (*RemoteRepository) Ref

func (r *RemoteRepository) Ref() string

Ref is Git branch or tag.

func (*RemoteRepository) String

func (r *RemoteRepository) String() string

func (*RemoteRepository) URL

func (r *RemoteRepository) URL() string

URL to Git repository.

func (*RemoteRepository) WorkingFs

func (r *RemoteRepository) WorkingFs() filesystem.Fs

type Repository

type Repository interface {
	String() string
	Definition() model.TemplateRepository
	CommitHash() string
	Fs() (filesystem.Fs, RepositoryFsUnlockFn)
}

type RepositoryFsUnlockFn

type RepositoryFsUnlockFn func()

Jump to

Keyboard shortcuts

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