git

package
v0.0.5-alpha Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StackerRefPrefix       = "refs/stacker/"
	StackerBaseRefPrefix   = StackerRefPrefix + "base/"
	StackerStartRefPrefix  = StackerRefPrefix + "start/"
	StackerRemoteRefPrefix = StackerRefPrefix + "remote/"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BranchName

type BranchName string

func (BranchName) RefName

func (n BranchName) RefName() RefName

func (BranchName) StackerBaseRefName

func (n BranchName) StackerBaseRefName() RefName

func (BranchName) StackerRemoteRefName

func (n BranchName) StackerRemoteRefName() RefName

func (BranchName) StackerStartRefName

func (n BranchName) StackerStartRefName() RefName

func (BranchName) String

func (n BranchName) String() string

type Git

type Git interface {
	Exec(args ...string) (Result, error)
	DumpOutput()
}

type ObjectName

type ObjectName string
const NonExistantObject ObjectName = "0000000000000000000000000000000000000000"

func (ObjectName) String

func (n ObjectName) String() string

type Ref

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

func (Ref) Name

func (r Ref) Name() RefName

func (Ref) ObjectName

func (r Ref) ObjectName() ObjectName

func (Ref) Remote

func (r Ref) Remote() RemoteName

func (Ref) RemoteRefName

func (r Ref) RemoteRefName() RefName

func (Ref) Stacker

func (r Ref) Stacker() bool

func (Ref) SymRefTarget

func (r Ref) SymRefTarget() RefName

func (Ref) UpstreamRef

func (r Ref) UpstreamRef() RefName

type RefName

type RefName string

func ParseRefName

func ParseRefName(name string) (RefName, error)

func (RefName) BranchName

func (n RefName) BranchName() BranchName

func (RefName) String

func (n RefName) String() string

type RefType

type RefType int
const (
	TypeCommit RefType
	TypeTree
	TypeBlob
	TypeTag
)

func (RefType) MarshalText

func (t RefType) MarshalText() ([]byte, error)

func (*RefType) UnmarshalText

func (t *RefType) UnmarshalText(text []byte) error

type RemoteName

type RemoteName string

func (RemoteName) String

func (n RemoteName) String() string

type Repository

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

func SnapshotRepository

func SnapshotRepository(g Git) (Repository, error)

func (Repository) AllRefs

func (r Repository) AllRefs() []Ref

func (Repository) Head

func (r Repository) Head() (BranchName, bool)

func (Repository) LookupBranch

func (r Repository) LookupBranch(name string) (BranchName, bool)

func (Repository) LookupRef

func (r Repository) LookupRef(name RefName) (ref Ref, ok bool)

type Result

type Result struct {
	Args     []string
	Stdout   bytes.Buffer
	Stderr   bytes.Buffer
	ExitCode int
}

type Runner

type Runner struct {
	WorkDir       string
	Env           []string
	PrintCommands bool
	// contains filtered or unexported fields
}

func (*Runner) DumpOutput

func (r *Runner) DumpOutput()

func (*Runner) Exec

func (r *Runner) Exec(args ...string) (Result, error)

Jump to

Keyboard shortcuts

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