vcs

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2021 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package vcs abstracts version control systems. Currently just git.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommitOpts

type CommitOpts struct {
	Message     string
	Author      string
	AuthorEmail string
}

type Interface

type Interface interface {
	Fetch(ctx context.Context, upstream, ref string) error
	Push(ctx context.Context, upstream, ref string, opts PushOpts) error
	Commit(ctx context.Context, opts CommitOpts) error
	ReadCommits(ctx context.Context, query string) ([]*model.Commit, error)
	CreateTag(ctx context.Context, commit, tag string, opts TagOpts) error
	DeleteTag(ctx context.Context, commit, tag string) error
	ReadTags(ctx context.Context, query string) ([]string, error)
	GetMainBranch(ctx context.Context, candidates []string) (string, error)
	CurrentBranch(ctx context.Context) (string, error)
	BranchContains(ctx context.Context, commit, branch string) (bool, error)
	CurrentCommit(ctx context.Context) (string, error)
}

type Mock

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

func NewMock

func NewMock() *Mock

func (*Mock) BranchContains

func (m *Mock) BranchContains(ctx context.Context, commit, branch string) (bool, error)

func (*Mock) Commit

func (m *Mock) Commit(ctx context.Context, opts CommitOpts) error

func (*Mock) CreateTag

func (m *Mock) CreateTag(ctx context.Context, commit, tag string, opts TagOpts) error

func (*Mock) CurrentBranch

func (m *Mock) CurrentBranch(ctx context.Context) (string, error)

func (*Mock) CurrentCommit

func (m *Mock) CurrentCommit(ctx context.Context) (string, error)

func (*Mock) DeleteTag

func (m *Mock) DeleteTag(ctx context.Context, commit, tag string) error

func (*Mock) Fetch

func (m *Mock) Fetch(ctx context.Context, upstream, ref string) error

func (*Mock) GetMainBranch

func (m *Mock) GetMainBranch(ctx context.Context, candidates []string) (string, error)

func (*Mock) Push

func (m *Mock) Push(ctx context.Context, upstream, ref string, opts PushOpts) error

func (*Mock) ReadCommits

func (m *Mock) ReadCommits(ctx context.Context, query string) ([]*model.Commit, error)

func (*Mock) ReadTags

func (m *Mock) ReadTags(ctx context.Context, query string) ([]string, error)

func (*Mock) SetCommits

func (m *Mock) SetCommits(commits ...*model.Commit) *Mock

func (*Mock) SetTags

func (m *Mock) SetTags(tags ...string) *Mock

type NotFoundError

type NotFoundError struct {
	Ref string
}

func (NotFoundError) Error

func (e NotFoundError) Error() string

type PushOpts

type PushOpts struct {
	Tags       bool
	FollowTags bool
}

type TagOpts

type TagOpts struct {
	Message     string
	Author      string
	AuthorEmail string
}

Directories

Path Synopsis
Package gitcli implements vcs.Interface using the git commandline tool.
Package gitcli implements vcs.Interface using the git commandline tool.

Jump to

Keyboard shortcuts

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