Documentation ¶
Index ¶
- Constants
- Variables
- func ColorBranchState(state string) string
- type BranchDetail
- type Repository
- func (repo *Repository) AddRemote(remote, url string) error
- func (repo *Repository) Checkout(name string, create bool) error
- func (repo *Repository) ConfigRemote(branch, remote string) error
- func (repo *Repository) ConfigUserEmail(user, email string) error
- func (repo *Repository) Exec(args ...string) error
- func (repo *Repository) ExecColor(args ...string) error
- func (repo *Repository) Fetch(prune, pruneTag bool) error
- func (repo *Repository) GetRemoteURL(remote string) (string, error)
- func (repo *Repository) LatestTag() (string, error)
- func (repo *Repository) ListLocalBranches() ([]*BranchDetail, error)
- func (repo *Repository) ListRemoteBranches(remote string, locals []*BranchDetail) ([]string, error)
- func (repo *Repository) ListRemotes() ([]string, error)
- func (repo *Repository) ListTags() ([]string, error)
- func (repo *Repository) Output(args ...string) (string, error)
- func (repo *Repository) RemoveBranch(branch string) error
- func (repo *Repository) SetRemoteURL(remote, url string) error
- func (repo *Repository) UncommittedChanges() ([]string, error)
Constants ¶
View Source
const ( BranchSync = "[sync]" BranchGone = "[deleted]" BranchAhead = "[ahead]" BranchBehind = "[behind]" BranchConflict = "[conflict]" BranchDetached = "[detached]" BranchLocal = "none" )
Variables ¶
View Source
var Default = New("")
Functions ¶
func ColorBranchState ¶
Types ¶
type BranchDetail ¶
type BranchDetail struct { Name string State string Current bool IsRemote bool Remote string Commit string CommitMsg string }
func ParseBranchDetail ¶
func ParseBranchDetail(line string) (*BranchDetail, error)
func (*BranchDetail) ColorName ¶
func (b *BranchDetail) ColorName() string
func (*BranchDetail) ColorRemote ¶
func (b *BranchDetail) ColorRemote() string
type Repository ¶
type Repository struct {
Path string
}
func New ¶
func New(path string) *Repository
func (*Repository) AddRemote ¶
func (repo *Repository) AddRemote(remote, url string) error
func (*Repository) ConfigRemote ¶
func (repo *Repository) ConfigRemote(branch, remote string) error
func (*Repository) ConfigUserEmail ¶
func (repo *Repository) ConfigUserEmail(user, email string) error
func (*Repository) Exec ¶
func (repo *Repository) Exec(args ...string) error
func (*Repository) ExecColor ¶ added in v0.0.2
func (repo *Repository) ExecColor(args ...string) error
func (*Repository) Fetch ¶
func (repo *Repository) Fetch(prune, pruneTag bool) error
func (*Repository) GetRemoteURL ¶ added in v0.0.2
func (repo *Repository) GetRemoteURL(remote string) (string, error)
func (*Repository) LatestTag ¶
func (repo *Repository) LatestTag() (string, error)
func (*Repository) ListLocalBranches ¶
func (repo *Repository) ListLocalBranches() ([]*BranchDetail, error)
func (*Repository) ListRemoteBranches ¶
func (repo *Repository) ListRemoteBranches(remote string, locals []*BranchDetail) ([]string, error)
func (*Repository) ListRemotes ¶
func (repo *Repository) ListRemotes() ([]string, error)
func (*Repository) ListTags ¶
func (repo *Repository) ListTags() ([]string, error)
func (*Repository) RemoveBranch ¶
func (repo *Repository) RemoveBranch(branch string) error
func (*Repository) SetRemoteURL ¶ added in v0.0.2
func (repo *Repository) SetRemoteURL(remote, url string) error
func (*Repository) UncommittedChanges ¶
func (repo *Repository) UncommittedChanges() ([]string, error)
Click to show internal directories.
Click to hide internal directories.