git

package
v0.0.0-...-d611558 Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoSuchRemote = errors.New("no such remote")
View Source
var ErrNotRepository = errors.New("not a git repository")

Functions

This section is empty.

Types

type GitCli

type GitCli interface {
	tools.ExternalTool
	GetRemoteUrl(ctx context.Context, string, remoteName string) (string, error)
	ShallowClone(ctx context.Context, repositoryPath string, branch string, target string) error
	InitRepo(ctx context.Context, repositoryPath string) error
	AddRemote(ctx context.Context, repositoryPath string, remoteName string, remoteUrl string) error
	UpdateRemote(ctx context.Context, repositoryPath string, remoteName string, remoteUrl string) error
	GetCurrentBranch(ctx context.Context, repositoryPath string) (string, error)
	GetRepoRoot(ctx context.Context, repositoryPath string) (string, error)
	AddFile(ctx context.Context, repositoryPath string, filespec string) error
	Commit(ctx context.Context, repositoryPath string, message string) error
	PushUpstream(ctx context.Context, repositoryPath string, origin string, branch string) error
	IsUntrackedFile(ctx context.Context, repositoryPath string, filePath string) (bool, error)
	SetCredentialStore(ctx context.Context, repositoryPath string) error
	ListStagedFiles(ctx context.Context, repositoryPath string) (string, error)
	AddFileExecPermission(ctx context.Context, repositoryPath string, file string) error
	// make current repo to use gh-cli as credential helper.
	SetGitHubAuthForRepo(ctx context.Context, repositoryPath, credential, ghPath string) error
}

func NewGitCli

func NewGitCli(commandRunner exec.CommandRunner) GitCli

Jump to

Keyboard shortcuts

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