git

package
v0.0.0-...-1cde5fb Latest Latest
Warning

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

Go to latest
Published: May 12, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OpenGitRepository

func OpenGitRepository(path string) (*git.Repository, error)

Types

type ListRefsFunc

type ListRefsFunc func(ctx context.Context, ref *plumbing.Reference) error

type Repository

type Repository struct {
	Name                     string
	Namespace                string
	OriginName               string
	DefaultMainReferenceName plumbing.ReferenceName
	DefaultFetchSpec         []config.RefSpec
	URL                      string
	Directory                string
	CredentialSecret         string
	CredentialResolver       auth.CredentialResolver
	UserInfoProvider         auth.UserInfoProvider

	Repo *git.Repository
	// contains filtered or unexported fields
}

func (*Repository) FetchRemoteRepository

func (r *Repository) FetchRemoteRepository(ctx context.Context) error

func (*Repository) InitEmptyRepository

func (r *Repository) InitEmptyRepository() (*git.Repository, error)

initEmptyRepository initializes an empty bare repository

func (*Repository) InitializeDefaultBranches

func (r *Repository) InitializeDefaultBranches(repo *git.Repository) error

initializeDefaultBranches

func (*Repository) InitializeOrigin

func (r *Repository) InitializeOrigin(repo *git.Repository) error

func (*Repository) ListRefs

func (r *Repository) ListRefs(ctx context.Context, listRefsFunc ListRefsFunc) error

func (*Repository) PushAndCleanup

func (r *Repository) PushAndCleanup(ctx context.Context, specs, require []config.RefSpec) error

pushes the local reference to the remote repository

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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