gitgeneric

package
v0.38.1 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GitHandler added in v0.28.0

type GitHandler interface {
	Add(files []string, workingDir string) error
	Checkout(username, password, branch, remoteBranch, workingDir string) error
	Clone(username, password, URL, workingDir string) error
	Commit(user, email, message, workingDir string, signingKey string, passprase string) error
	GetChangedFiles(workingDir string) ([]string, error)
	IsSimilarBranch(a, b, workingDir string) (bool, error)
	NewTag(tag, message, workingDir string) (bool, error)
	Push(username string, password string, workingDir string, force bool) error
	PushTag(tag string, username string, password string, workingDir string, force bool) error
	RemoteURLs(workingDir string) (map[string]string, error)
	SanitizeBranchName(branch string) string
	Tags(workingDir string) (tags []string, err error)
}

type GoGit added in v0.28.0

type GoGit struct {
}

func (GoGit) Add added in v0.28.0

func (g GoGit) Add(files []string, workingDir string) error

Add run `git add`.

func (GoGit) Checkout added in v0.28.0

func (g GoGit) Checkout(username, password, branch, remoteBranch, workingDir string) error

Checkout create and then uses a temporary git branch.

func (GoGit) Clone added in v0.28.0

func (g GoGit) Clone(username, password, URL, workingDir string) error

Clone run `git clone`.

func (GoGit) Commit added in v0.28.0

func (g GoGit) Commit(user, email, message, workingDir string, signingKey string, passprase string) error

Commit run `git commit`.

func (GoGit) GetChangedFiles added in v0.28.0

func (g GoGit) GetChangedFiles(workingDir string) ([]string, error)

func (GoGit) IsSimilarBranch added in v0.28.0

func (g GoGit) IsSimilarBranch(a, b, workingDir string) (bool, error)

IsSimilarBranch checks that the last commits of the two branches are similar then return true if it's the case

func (GoGit) NewTag added in v0.28.0

func (g GoGit) NewTag(tag, message, workingDir string) (bool, error)

NewTag create a tag then return a boolean to indicate if the tag was created or not.

func (GoGit) Push added in v0.28.0

func (g GoGit) Push(username string, password string, workingDir string, force bool) error

Push run `git push`.

func (GoGit) PushTag added in v0.28.0

func (g GoGit) PushTag(tag string, username string, password string, workingDir string, force bool) error

PushTag publish a single tag created locally

func (GoGit) RemoteURLs added in v0.28.0

func (g GoGit) RemoteURLs(workingDir string) (map[string]string, error)

RemoteURLs returns the list of remote URLs

func (GoGit) SanitizeBranchName added in v0.28.0

func (g GoGit) SanitizeBranchName(branch string) string

SanitizeBranchName replace wrong character in the branch name

func (GoGit) Tags added in v0.28.0

func (g GoGit) Tags(workingDir string) (tags []string, err error)

Tags return a list of git tags ordered by creation time

type MockGit added in v0.28.0

type MockGit struct {
	GitHandler // Ensure any unspecified method from this interface are still declared
	Remotes    map[string]string
	Err        error
}

MockGit is a stub implementation of the `GitHandler` interface to be used in our unit test suites.

func (MockGit) RemoteURLs added in v0.28.0

func (m MockGit) RemoteURLs(workingDir string) (map[string]string, error)

Jump to

Keyboard shortcuts

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