repository

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

func Apply added in v0.3.0

func Apply(c Commit, opts ...CommitOptions) error

func NotFoundError added in v0.1.3

func NotFoundError() error

func WithAmend added in v0.3.0

func WithAmend(b bool) func(c *Commit)

func WithDryRun added in v0.3.0

func WithDryRun(b bool) func(c *Commit)

Types

type Branch

type Branch struct {
	Local  string
	Remote string
	Refs   []string
}

type Brancher added in v0.3.0

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

type Commit added in v0.2.0

type Commit struct {
	Author  string
	Subject string
	Body    string
	Footer  string
	Amend   bool
	DryRun  bool
	Runner  func(w io.Writer, command string, args []string) error
}

type CommitOptions added in v0.3.0

type CommitOptions func(c *Commit)

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
}
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 RefsOptions added in v0.3.0

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

type RefsResult added in v0.3.0

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

type Remoter added in v0.3.0

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

type Repository

type Repository struct {
	Configer     Configer
	GlobalConfig func(scope config.Scope) (*config.Config, error)
	Remoter      Remoter
	Header       Header
	Brancher     Brancher
}

func New

func New() (*Repository, 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) Remotes added in v0.3.0

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

func (*Repository) Users

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

type User

type User struct {
	Name  string
	Email string
}

Jump to

Keyboard shortcuts

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