repositorystore

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2021 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GitBinary = "git"

Functions

func GetDefaultBranch

func GetDefaultBranch(repository *domain.GitRepository) (string, error)

GetDefaultBranch returns the name of the default branch in origin. Returns an error if either Git command failed or if no default branch could be detected.

func HasCommitsBetween

func HasCommitsBetween(repository *domain.GitRepository, rootBranch, headBranch string) (bool, error)

HasCommitsBetween returns true if there are commits in the given revision range. If headBranch is empty, "HEAD" is used. Returns ErrInvalidArgument if rootBranch is empty. Returns errors in all other Git failures.

Types

type ManagedGitRepo

type ManagedGitRepo struct {
	Name string
}

ManagedGitRepo is the representation of the managed git repos in the config file.

type RepositoryStore

type RepositoryStore struct {
	StoreConfig
	// contains filtered or unexported fields
}

func NewRepositoryStore

func NewRepositoryStore(instrumentation *RepositoryStoreInstrumentation) *RepositoryStore

func (*RepositoryStore) Add

func (s *RepositoryStore) Add(repository *domain.GitRepository) error

func (*RepositoryStore) Checkout

func (s *RepositoryStore) Checkout(repository *domain.GitRepository) error

func (*RepositoryStore) Clone

func (s *RepositoryStore) Clone(repository *domain.GitRepository) error

func (*RepositoryStore) Commit

func (s *RepositoryStore) Commit(repository *domain.GitRepository, options domain.CommitOptions) error

func (*RepositoryStore) Diff

func (s *RepositoryStore) Diff(repository *domain.GitRepository) (string, error)

func (*RepositoryStore) Fetch

func (s *RepositoryStore) Fetch(repository *domain.GitRepository) error

func (*RepositoryStore) FetchGitRepositories

func (s *RepositoryStore) FetchGitRepositories() ([]*domain.GitRepository, error)

func (*RepositoryStore) IsDirty

func (s *RepositoryStore) IsDirty(repository *domain.GitRepository) bool

func (*RepositoryStore) Pull

func (s *RepositoryStore) Pull(repository *domain.GitRepository) error

func (*RepositoryStore) Push

func (s *RepositoryStore) Push(repository *domain.GitRepository, options domain.PushOptions) error

func (*RepositoryStore) Reset

func (s *RepositoryStore) Reset(repository *domain.GitRepository) error

type RepositoryStoreInstrumentation

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

func NewRepositoryStoreInstrumentation

func NewRepositoryStoreInstrumentation(factory logging.LoggerFactory) *RepositoryStoreInstrumentation

type StoreConfig

type StoreConfig struct {
	ParentDir        string
	DefaultNamespace string
	CommitBranch     string

	IncludeFilter string
	ExcludeFilter string
	// ManagedReposFileName is the base file name where managed git repositories config is searched.
	ManagedReposFileName string
}

Jump to

Keyboard shortcuts

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