git

package
v0.0.0-...-03a9efe Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func (*Client) Clone

func (d *Client) Clone(ctx context.Context, path string, isBare bool, o *git.CloneOptions) (*git.Repository, error)

func (*Client) DefaultBranch

func (d *Client) DefaultBranch() (*gitp.Reference, error)

func (*Client) Fetch

func (d *Client) Fetch(o *git.FetchOptions) error

func (*Client) PlainCheckout

func (d *Client) PlainCheckout(o *git.CheckoutOptions) error

func (*Client) ResolveRevisionOrBranchHead

func (d *Client) ResolveRevisionOrBranchHead(rev gitp.Revision) (*gitp.Hash, error)

func (*Client) Worktree

func (d *Client) Worktree() (*git.Worktree, error)

type Cloner

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

func NewCloner

func NewCloner(repoClient RepoClient, repo *reconciler.Repository, autoCheckout bool, logger *zap.SugaredLogger) (*Cloner, error)

func (*Cloner) Checkout

func (r *Cloner) Checkout(rev string, repo *git.Repository) error

Checkout checks out the given revision. revision can be 'main', a release version (e.g. 1.4.1), a commit hash (e.g. 34edf09a).

func (*Cloner) Clone

func (r *Cloner) Clone(path string) (*git.Repository, error)

Clone clones the repository from the given remote URL to the given `path` in the local filesystem.

func (*Cloner) CloneAndCheckout

func (r *Cloner) CloneAndCheckout(dstPath, rev string) error

func (*Cloner) FetchAndCheckout

func (r *Cloner) FetchAndCheckout(path, version string) error

func (*Cloner) ResolveRevisionOrBranchHead

func (r *Cloner) ResolveRevisionOrBranchHead(rev string) (*gitp.Hash, error)

type RepoClient

type RepoClient interface {
	Clone(ctx context.Context, path string, isBare bool, o *git.CloneOptions) (*git.Repository, error)
	Worktree() (*git.Worktree, error)
	ResolveRevisionOrBranchHead(rev gitp.Revision) (*gitp.Hash, error)
	Fetch(o *git.FetchOptions) error
	PlainCheckout(o *git.CheckoutOptions) error
	DefaultBranch() (*gitp.Reference, error)
}

func NewClientWithPath

func NewClientWithPath(path string) (RepoClient, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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