git2go

package
v16.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2023 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LegacyErrPrefixInvalidBranch        = "Invalid branch"
	LegacyErrPrefixInvalidSubmodulePath = "Invalid submodule path"
	LegacyErrPrefixFailedCommit         = "Failed to create commit"
)

Error strings present in the legacy Ruby implementation

Variables

View Source
var (
	// ErrInvalidArgument is returned in case the merge arguments are invalid.
	ErrInvalidArgument = errors.New("invalid parameters")

	// BinaryName is the name of the gitaly-git2go binary.
	BinaryName = "gitaly-git2go"
)
View Source
var NewSignature = git.NewSignature

NewSignature creates a new sanitized signature, syned from internal/git.

Functions

func SerializableError

func SerializableError(err error) error

SerializableError returns an error that is Gob serializable. Registered types are serialized directly. Unregistered types are transformed in to an opaque error using their error message. Wrapped errors remain unwrappable.

Types

type CommitNotFoundError

type CommitNotFoundError struct {
	// Revision used to lookup the commit
	Revision string
}

CommitNotFoundError indicates that the given commit rev could not be found.

func (CommitNotFoundError) Error

func (err CommitNotFoundError) Error() string

type ConflictingFilesError

type ConflictingFilesError struct {
	// ConflictingFiles is the set of files which have conflicts.
	ConflictingFiles []string
}

ConflictingFilesError is an error raised when there are conflicting files.

func (ConflictingFilesError) Error

func (err ConflictingFilesError) Error() string

type EmptyError

type EmptyError struct{}

EmptyError indicates the command, for example cherry-pick, did result in no changes, so the result is empty.

func (EmptyError) Error

func (err EmptyError) Error() string

type Executor

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

Executor executes gitaly-git2go.

func NewExecutor

func NewExecutor(cfg config.Cfg, gitCmdFactory git.CommandFactory, locator storage.Locator) *Executor

NewExecutor returns a new gitaly-git2go executor using binaries as configured in the given configuration.

func (*Executor) Rebase

Rebase performs the rebase via gitaly-git2go

type FeatureFlag

type FeatureFlag struct {
	// MetadataKey is the metadata key of the feature flag.
	MetadataKey string
	// Name is the name of the feature flag.
	Name string
	// Value is the value of the feature flag.
	Value bool
}

FeatureFlag is a feature flag state as seen by the `gitaly-git2go featureflag` test subcommand.

type FeatureFlags

type FeatureFlags struct {
	// Flags is the set of feature flags observed by the command.
	Flags []FeatureFlag
	// Err is set if an error occurred. Err must exist on all gob serialized
	// results so that any error can be returned.
	Err error
}

FeatureFlags is a struct only used by tests to confirm that feature flags are being properly propagated from the git2go Executor to the gitaly-git2go binary

type HasConflictsError

type HasConflictsError struct{}

HasConflictsError is used when a change, for example a revert, could not be applied due to a conflict.

func (HasConflictsError) Error

func (err HasConflictsError) Error() string

type IndexError

type IndexError struct {
	Path string
	Type IndexErrorType
}

IndexError is a well-defined error that was produced by performing an invalid operation on the index.

func (IndexError) Error

func (err IndexError) Error() string

Error returns the error message associated with the error type.

func (IndexError) Proto

func (err IndexError) Proto() *gitalypb.IndexError

Proto returns the Protobuf representation of this error.

func (IndexError) StructuredError

func (err IndexError) StructuredError() structerr.Error

StructuredError returns the structured error.

type IndexErrorType

type IndexErrorType uint

IndexErrorType specifies which of the known index error types has occurred.

const (
	// ErrDirectoryExists represent a directory exists error.
	ErrDirectoryExists IndexErrorType = iota
	// ErrDirectoryTraversal represent a directory traversal error.
	ErrDirectoryTraversal
	// ErrEmptyPath represent an empty path error.
	ErrEmptyPath
	// ErrFileExists represent a file exists error.
	ErrFileExists
	// ErrFileNotFound represent a file not found error.
	ErrFileNotFound
	// ErrInvalidPath represent an invalid path error.
	ErrInvalidPath
)

type InvalidArgumentError

type InvalidArgumentError string

InvalidArgumentError is returned when an invalid argument is provided.

func (InvalidArgumentError) Error

func (err InvalidArgumentError) Error() string

type RebaseCommand

type RebaseCommand struct {
	// Repository is the path to execute rebase in.
	Repository string
	// Committer contains the the committer signature.
	Committer Signature
	// BranchName is the branch that is rebased. Deprecated, can be removed in the next release.
	BranchName string
	// UpstreamRevision is the revision where the branch is rebased onto. Deprecated, can be
	// removed in the next release.
	UpstreamRevision string
	// CommitID is the object ID of the commit that shall be rebased. Deprecates BranchName.
	CommitID git.ObjectID
	// UpstreamCommitID is the object ID of the commit which is considered to be the
	// upstream branch. This parameter determines both the commit onto which we're
	// about to rebase, which is the merge base of the upstream commit and rebased
	// commit, and which commits should be rebased, which is the commit range
	// upstream..commit. Deprecates the UpstreamRevision.
	UpstreamCommitID git.ObjectID
	// SkipEmptyCommits will cause commits which have already been applied on the target branch
	// and which are thus empty to be skipped. If unset, empty commits will cause the rebase to
	// fail.
	SkipEmptyCommits bool
	// SigningKey is a path to the key to sign commit using OpenPGP
	SigningKey string
}

RebaseCommand contains parameters to rebase a branch.

type Result

type Result struct {
	// CommitID is the result of the call.
	CommitID string
	// Err is set if an error occurred. Err must exist on all gob serialized
	// results so that all errors can be returned.
	Err error
}

Result is the serialized result.

type Signature

type Signature = git.Signature

Signature represents a commits signature, synced from internal/git.

type UnknownIndexError

type UnknownIndexError string

UnknownIndexError is an unspecified error that was produced by performing an invalid operation on the index.

func (UnknownIndexError) Error

func (err UnknownIndexError) Error() string

Error returns the error message of the unknown index error.

Jump to

Keyboard shortcuts

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