repository

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrLocalBranchNotFound = errors.New("local branch not found")

Functions

This section is empty.

Types

type Branch

type Branch struct {
	Local  string
	Remote string
	Refs   Refs
}

type BranchOptions added in v0.9.1

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

type Brancher added in v0.3.0

type Brancher interface {
	Configer
	Head() (*plumbing.Reference, error)
	References() (storer.ReferenceIter, error)
	TagObject(plumbing.Hash) (*object.Tag, error)
}

type Commit added in v0.2.0

type Commit struct {
	Author      string
	Subject     string
	Body        string
	Footer      string
	Amend       bool
	DryRun      bool
	File        bool
	MessageFile string
}

type Configer added in v0.3.0

type Configer interface {
	Config() (*config.Config, error)
}

type Description added in v0.3.0

type Description struct {
	Users    []User
	Remotes  []string
	Head     Head
	Branch   Branch
	Worktree Worktree
}
type Head struct {
	Hash    string
	Author  User
	When    time.Time
	Message string
}
type Header interface {
	Head() (*plumbing.Reference, error)
	CommitObject(h plumbing.Hash) (*object.Commit, error)
}

type Refs added in v0.9.1

type Refs struct {
	Locals  []string
	Remotes []string
	Tags    []string
}

type Remoter added in v0.3.0

type Remoter interface {
	Remotes() ([]*git.Remote, error)
}

type Repository

type Repository struct {
	Opener       func(string, *git.PlainOpenOptions) (*git.Repository, error)
	Runner       func(io.Writer, string, []string) error
	OpenFiler    func(string, int, os.FileMode) (*os.File, error)
	GlobalConfig func(config.Scope) (*config.Config, error)
	Configer     Configer
	Remoter      Remoter
	Header       Header
	Brancher     Brancher
	Worktreer    Worktreer
}

func New

func New() *Repository

func (*Repository) Apply added in v0.8.0

func (r *Repository) Apply(c Commit) error

func (*Repository) Branch

func (r *Repository) Branch() (Branch, error)

func (*Repository) Describe added in v0.3.0

func (r *Repository) Describe() (Description, error)

func (*Repository) Head added in v0.3.0

func (r *Repository) Head() (Head, error)

func (*Repository) IgnoreGlobalConfig added in v0.9.1

func (r *Repository) IgnoreGlobalConfig()

func (*Repository) Open added in v0.5.0

func (r *Repository) Open() error

func (*Repository) Remotes added in v0.3.0

func (r *Repository) Remotes() ([]string, error)

func (*Repository) Users

func (r *Repository) Users() ([]User, error)

func (*Repository) Worktree added in v0.7.0

func (r *Repository) Worktree() (Worktree, error)

type User

type User struct {
	Name    string `yaml:"name,omitempty"`
	Email   string `yaml:"email,omitempty"`
	Default bool   `yaml:"default,omitempty"`
}

type Worktree added in v0.7.0

type Worktree struct {
	Status git.Status
}

func (*Worktree) IsStaged added in v0.9.0

func (w *Worktree) IsStaged() bool

type Worktreer added in v0.7.0

type Worktreer interface {
	Worktree() (*git.Worktree, error)
}

Jump to

Keyboard shortcuts

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