Documentation ¶
Index ¶
- Variables
- func AddUpstreamRemote(upstreamURL, cloneDir string, branches []string) error
- func CheckoutBranch(branch string) error
- func CommitBody(sha string) (string, error)
- func Config(name string) (string, error)
- func CurrentBranch() (string, error)
- func DeleteLocalBranch(branch string) error
- func HasLocalBranch(branch string) bool
- func IsURL(u string) bool
- func ParseURL(rawURL string) (u *url.URL, err error)
- func Push(remote string, ref string, cmdOut, cmdErr io.Writer) error
- func RunClone(cloneURL string, args []string) (target string, err error)
- func SetRemoteResolution(name, resolution string) error
- func ToplevelDir() (string, error)
- func UncommittedChangeCount() (int, error)
- type BranchConfig
- type Commit
- type Ref
- type Remote
- type RemoteSet
- type TrackingRef
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotOnAnyBranch = errors.New("git: not on any branch")
ErrNotOnAnyBranch indicates that the user is in detached HEAD state
View Source
var GitCommand = func(args ...string) (*execlog.Cmd, error) { gitExe, err := execlog.LookPath("git") if err != nil { programName := "git" if runtime.GOOS == "windows" { programName = "Git for Windows" } return nil, fmt.Errorf("unable to find git executable in PATH; please install %s before retrying", programName) } return execlog.Command(gitExe, args...), nil }
Functions ¶
func AddUpstreamRemote ¶
func CheckoutBranch ¶
func CommitBody ¶
func CurrentBranch ¶
CurrentBranch reads the checked-out branch for the git repository
func DeleteLocalBranch ¶
func HasLocalBranch ¶
func SetRemoteResolution ¶
func ToplevelDir ¶
ToplevelDir returns the top-level directory path of the current repository
func UncommittedChangeCount ¶
Types ¶
type BranchConfig ¶
func ReadBranchConfig ¶
func ReadBranchConfig(branch string) (cfg BranchConfig)
ReadBranchConfig parses the `branch.BRANCH.(remote|merge)` part of git config
type Commit ¶
func LastCommit ¶
type Remote ¶
Remote is a parsed git remote
type TrackingRef ¶
TrackingRef represents a ref for a remote tracking branch
func (TrackingRef) String ¶
func (r TrackingRef) String() string
Click to show internal directories.
Click to hide internal directories.