repository

package
v0.0.0-...-5923d8e Latest Latest
Warning

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

Go to latest
Published: May 6, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Git

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

Git is the version control client for git

func New

func New(path string) (*Git, error)

New creates an new instance of the git client

func (*Git) BranchTags

func (vc *Git) BranchTags(branchName string) []string

BranchTags lists all existing tags associated to commits of the given branch.

func (*Git) CreateTag

func (vc *Git) CreateTag(tag string) error

CreateTag creates a local git tag.

func (*Git) DeleteTag

func (vc *Git) DeleteTag(tag string) error

DeleteTag deletes a local git tag.

func (*Git) ExistsTag

func (vc *Git) ExistsTag(version string) (bool, error)

ExistsTag validates the parameter version and returns the existence of the git tag.

func (*Git) HasStagedChanges

func (vc *Git) HasStagedChanges() bool

HasStagedChanges checks the git repo stash for staged changes Note: the current version of the go-git doesn't support this functionality.

func (*Git) HasUncommittedChanges

func (vc *Git) HasUncommittedChanges() (bool, error)

HasUncommittedChanges checks the git repo for uncommitted changes.

func (*Git) IsBehind

func (vc *Git) IsBehind(ctx context.Context) (bool, error)

IsBehind checks the local repo with the origin and validate the state of the git repo

func (*Git) IsSafe

func (vc *Git) IsSafe(ctx context.Context) error

IsSafe validate the state of the git repo and returns an error if the repo is unsafe like include uncommitted files or the local branch is behind the origin.

func (*Git) LatestCommitHash

func (vc *Git) LatestCommitHash() string

LatestCommitHash returns the latest commit hash of the git repo. In case of an error the result is empty.

func (*Git) Push

func (vc *Git) Push(ctx context.Context) error

Push pushes the local repo state to the origin.

func (*Git) Tags

func (vc *Git) Tags() []string

Tags lists all existing tags of the git repo.

type NoOpRepository

type NoOpRepository struct{}

NoOpRepository is the implementation of an no-operation client.

func NewNoOp

func NewNoOp() *NoOpRepository

NewNoOp creates an new instance of the No-Operation object

func (*NoOpRepository) BranchTags

func (noop *NoOpRepository) BranchTags(branchName string) []string

BranchTags does nothing

func (*NoOpRepository) CreateTag

func (noop *NoOpRepository) CreateTag(tag string) error

CreateTag does nothing.

func (*NoOpRepository) DeleteTag

func (noop *NoOpRepository) DeleteTag(tag string) error

DeleteTag does nothing.

func (*NoOpRepository) ExistsTag

func (noop *NoOpRepository) ExistsTag(version string) (bool, error)

ExistsTag does nothing.

func (*NoOpRepository) IsSafe

func (noop *NoOpRepository) IsSafe(ctx context.Context) error

IsSafe does nothing.

func (*NoOpRepository) LatestCommitHash

func (noop *NoOpRepository) LatestCommitHash() string

LatestCommitHash does nothing.

func (*NoOpRepository) Push

func (noop *NoOpRepository) Push(ctx context.Context) error

Push does nothing.

func (*NoOpRepository) Tags

func (noop *NoOpRepository) Tags() []string

Tags does nothing

Jump to

Keyboard shortcuts

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