git

package
v1.5.4 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2025 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 Conf

type Conf struct {
	RepoURL            string
	Reference          string
	BaseRef            string
	ClonePath          string
	TargetMetadataPath string
	RawDiffPath        string

	ConfAuth ConfAuth
}

Conf wraps the component configuration.

func NewConf

func NewConf() (*Conf, error)

NewConf returns a new configuration build from environment lookup.

type ConfAuth

type ConfAuth struct {
	Username    string
	AccessToken string
}

ConfAuth contains authentication configuration.

type Manager

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

func NewManager

func NewManager(conf *Conf) (*Manager, error)

NewManager returns a new default clone Manager.

func (*Manager) Clone

func (mgr *Manager) Clone(ctx context.Context) (*Repository, error)

Clone clones the configured repository from its default references and then checks out in the target reference if it differs from the base.

type Repository

type Repository struct {
	Repo    *git.Repository
	BaseRef string
}

Repository wraps a git repository to not leak deps.

func (*Repository) GetDiff

func (r *Repository) GetDiff(ctx context.Context) (string, error)

GetDiff returns the raw git diff between the target reference and the base reference. We try to resolve the base branch based on the passed configuration on relying on default branches main/master.

Jump to

Keyboard shortcuts

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