git

package
v1.101.0 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2025 License: MIT Imports: 11 Imported by: 0

README

This directory contains two zip archives which have git repositories inside. It's not straightforward to add a git repository inside a git repository, and this is a workaround.

Documentation

Overview

Package git is a generated GoMock package.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrReferenceNotFound = errors.New("reference not found")
	ErrCommitNotFound    = errors.New("commit not found")
	ErrEmptyCommitHash   = errors.New("empty commit hash")
	ErrUnstagedChanges   = errors.New("worktree contains unstaged changes")
)

Functions

This section is empty.

Types

type DiffEntries added in v1.81.1

type DiffEntries []DiffEntry

type DiffEntry added in v1.81.1

type DiffEntry struct {
	Name  string
	IsDir bool
}

type MockRepository added in v1.81.1

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

MockRepository is a mock of Repository interface.

func NewMockRepository added in v1.81.1

func NewMockRepository(ctrl *gomock.Controller) *MockRepository

NewMockRepository creates a new mock instance.

func (*MockRepository) Checkout added in v1.81.1

func (m *MockRepository) Checkout(reference string) error

Checkout mocks base method.

func (*MockRepository) CommitExists added in v1.82.0

func (m *MockRepository) CommitExists(commitHash string) (bool, error)

CommitExists mocks base method.

func (*MockRepository) DiffCommits added in v1.81.1

func (m *MockRepository) DiffCommits(beforeCommitHash, targetCommitHash string) (DiffEntries, error)

DiffCommits mocks base method.

func (*MockRepository) EXPECT added in v1.81.1

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockRepository) IsAncestor added in v1.81.1

func (m *MockRepository) IsAncestor(ancestor, other string) (bool, error)

IsAncestor mocks base method.

func (*MockRepository) ResolveCommitForReference added in v1.81.1

func (m *MockRepository) ResolveCommitForReference(reference string) (string, error)

ResolveCommitForReference mocks base method.

func (*MockRepository) ResolveTagsForCommit added in v1.81.1

func (m *MockRepository) ResolveTagsForCommit(commitHash string) ([]string, error)

ResolveTagsForCommit mocks base method.

type MockRepositoryMockRecorder added in v1.81.1

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

MockRepositoryMockRecorder is the mock recorder for MockRepository.

func (*MockRepositoryMockRecorder) Checkout added in v1.81.1

func (mr *MockRepositoryMockRecorder) Checkout(reference interface{}) *gomock.Call

Checkout indicates an expected call of Checkout.

func (*MockRepositoryMockRecorder) CommitExists added in v1.82.0

func (mr *MockRepositoryMockRecorder) CommitExists(commitHash interface{}) *gomock.Call

CommitExists indicates an expected call of CommitExists.

func (*MockRepositoryMockRecorder) DiffCommits added in v1.81.1

func (mr *MockRepositoryMockRecorder) DiffCommits(beforeCommitHash, targetCommitHash interface{}) *gomock.Call

DiffCommits indicates an expected call of DiffCommits.

func (*MockRepositoryMockRecorder) IsAncestor added in v1.81.1

func (mr *MockRepositoryMockRecorder) IsAncestor(ancestor, other interface{}) *gomock.Call

IsAncestor indicates an expected call of IsAncestor.

func (*MockRepositoryMockRecorder) ResolveCommitForReference added in v1.81.1

func (mr *MockRepositoryMockRecorder) ResolveCommitForReference(reference interface{}) *gomock.Call

ResolveCommitForReference indicates an expected call of ResolveCommitForReference.

func (*MockRepositoryMockRecorder) ResolveTagsForCommit added in v1.81.1

func (mr *MockRepositoryMockRecorder) ResolveTagsForCommit(commitHash interface{}) *gomock.Call

ResolveTagsForCommit indicates an expected call of ResolveTagsForCommit.

type Repository added in v1.81.1

type Repository interface {
	// Checkout a specific commit, or the commit of a branch or tag name.
	Checkout(reference string) error
	// ResolveCommitForReference gets the current commit for a branch or tag name.
	ResolveCommitForReference(reference string) (string, error)
	// IsAncestor checks if a commit, branch or tag is ancestor of other commit, branch or tag.
	IsAncestor(ancestor, other string) (bool, error)
	//  ResolveTagsForCommit returns tags for a specific commit.
	ResolveTagsForCommit(commitHash string) ([]string, error)
	// DiffCommits returns list of changes between two commits.
	// If beforeCommitHash is empty, all changes up till targetCommit is returned.
	DiffCommits(beforeCommitHash, targetCommitHash string) (DiffEntries, error)
	// CommitExists checks if a commit exists.
	CommitExists(commitHash string) (bool, error)
}

func Open added in v1.81.1

func Open(path string) (Repository, error)

Jump to

Keyboard shortcuts

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