git

package
v3.3.1 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClonerUsingGitExec

func ClonerUsingGitExec(repoSpec *RepoSpec) error

ClonerUsingGitExec uses a local git install, as opposed to say, some remote API, to obtain a local clone of a remote repo.

Types

type Cloner

type Cloner func(repoSpec *RepoSpec) error

Cloner is a function that can clone a git repo.

func DoNothingCloner

func DoNothingCloner(dir fs.ConfirmedDir) Cloner

DoNothingCloner returns a cloner that only sets cloneDir field in the repoSpec. It's assumed that the cloneDir is associated with some fake filesystem used in a test.

type RepoSpec

type RepoSpec struct {

	// Host, e.g. github.com
	Host string

	// orgRepo name (organization/repoName),
	// e.g. kubernetes-sigs/kustomize
	OrgRepo string

	// Dir where the orgRepo is cloned to.
	Dir fs.ConfirmedDir

	// Relative path in the repository, and in the cloneDir,
	// to a Kustomization.
	Path string

	// Branch or tag reference.
	Ref string

	// e.g. .git or empty in case of _git is present
	GitSuffix string
	// contains filtered or unexported fields
}

RepoSpec specifies a git repository and a branch and path therein.

func NewRepoSpecFromUrl

func NewRepoSpecFromUrl(n string) (*RepoSpec, error)

From strings like git@github.com:someOrg/someRepo.git or https://github.com/someOrg/someRepo?ref=someHash, extract the parts.

func (*RepoSpec) AbsPath

func (x *RepoSpec) AbsPath() string

func (*RepoSpec) Cleaner

func (x *RepoSpec) Cleaner(fSys fs.FileSystem) func() error

func (*RepoSpec) CloneDir

func (x *RepoSpec) CloneDir() fs.ConfirmedDir

func (*RepoSpec) CloneSpec

func (x *RepoSpec) CloneSpec() string

CloneSpec returns a string suitable for "git clone {spec}".

func (*RepoSpec) Raw

func (x *RepoSpec) Raw() string

Jump to

Keyboard shortcuts

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