Documentation ¶
Index ¶
- Variables
- func IsURL(u string) bool
- func ParseURL(rawURL string) (*url.URL, error)
- type BranchConfig
- type Client
- func (c *Client) AddRemote(ctx context.Context, name, urlStr string, trackingBranches []string) (*Remote, error)
- func (c *Client) AuthenticatedCommand(ctx context.Context, args ...string) (*Command, error)
- func (c *Client) CheckoutBranch(ctx context.Context, branch string) error
- func (c *Client) CheckoutNewBranch(ctx context.Context, remoteName, branch string) error
- func (c *Client) Clone(ctx context.Context, cloneURL string, args []string, mods ...CommandModifier) (string, error)
- func (c *Client) Command(ctx context.Context, args ...string) (*Command, error)
- func (c *Client) CommitBody(ctx context.Context, sha string) (string, error)
- func (c *Client) Commits(ctx context.Context, baseRef, headRef string) ([]*Commit, error)
- func (c *Client) Config(ctx context.Context, name string) (string, error)
- func (c *Client) Copy() *Client
- func (c *Client) CurrentBranch(ctx context.Context) (string, error)
- func (c *Client) DeleteLocalBranch(ctx context.Context, branch string) error
- func (c *Client) DeleteLocalTag(ctx context.Context, tag string) error
- func (c *Client) Fetch(ctx context.Context, remote string, refspec string, mods ...CommandModifier) error
- func (c *Client) GitDir(ctx context.Context) (string, error)
- func (c *Client) HasLocalBranch(ctx context.Context, branch string) bool
- func (c *Client) IsLocalGitRepo(ctx context.Context) (bool, error)
- func (c *Client) LastCommit(ctx context.Context) (*Commit, error)
- func (c *Client) PathFromRoot(ctx context.Context) string
- func (c *Client) Pull(ctx context.Context, remote, branch string, mods ...CommandModifier) error
- func (c *Client) Push(ctx context.Context, remote string, ref string, mods ...CommandModifier) error
- func (c *Client) ReadBranchConfig(ctx context.Context, branch string) (cfg BranchConfig)
- func (c *Client) Remotes(ctx context.Context) (RemoteSet, error)
- func (c *Client) SetRemoteBranches(ctx context.Context, remote string, refspec string) error
- func (c *Client) SetRemoteResolution(ctx context.Context, name, resolution string) error
- func (c *Client) ShowRefs(ctx context.Context, refs []string) ([]Ref, error)
- func (c *Client) ToplevelDir(ctx context.Context) (string, error)
- func (c *Client) TrackingBranchNames(ctx context.Context, prefix string) []string
- func (c *Client) UncommittedChangeCount(ctx context.Context) (int, error)
- func (c *Client) UnsetRemoteResolution(ctx context.Context, name string) error
- func (c *Client) UpdateRemoteURL(ctx context.Context, name, url string) error
- type Command
- type CommandModifier
- type Commit
- type GitError
- type NotInstalled
- 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.
Functions ¶
Types ¶
type BranchConfig ¶
type Client ¶ added in v2.18.0
type Client struct { GhPath string RepoDir string GitPath string Stderr io.Writer Stdin io.Reader Stdout io.Writer // contains filtered or unexported fields }
func (*Client) AuthenticatedCommand ¶ added in v2.18.0
AuthenticatedCommand is a wrapper around Command that included configuration to use gh as the credential helper for git.
func (*Client) CheckoutBranch ¶ added in v2.18.0
func (*Client) CheckoutNewBranch ¶ added in v2.18.0
func (*Client) CommitBody ¶ added in v2.18.0
func (*Client) CurrentBranch ¶ added in v2.18.0
CurrentBranch reads the checked-out branch for the git repository.
func (*Client) DeleteLocalBranch ¶ added in v2.18.0
func (*Client) DeleteLocalTag ¶ added in v2.35.0
func (*Client) HasLocalBranch ¶ added in v2.18.0
func (*Client) IsLocalGitRepo ¶ added in v2.22.0
func (*Client) LastCommit ¶ added in v2.18.0
func (*Client) PathFromRoot ¶ added in v2.18.0
Show current directory relative to the top-level directory of repository.
func (*Client) ReadBranchConfig ¶ added in v2.18.0
func (c *Client) ReadBranchConfig(ctx context.Context, branch string) (cfg BranchConfig)
ReadBranchConfig parses the `branch.BRANCH.(remote|merge)` part of git config.
func (*Client) SetRemoteBranches ¶ added in v2.31.0
func (*Client) SetRemoteResolution ¶ added in v2.18.0
func (*Client) ToplevelDir ¶ added in v2.18.0
ToplevelDir returns the top-level directory path of the current repository.
func (*Client) TrackingBranchNames ¶ added in v2.26.0
func (*Client) UncommittedChangeCount ¶ added in v2.18.0
func (*Client) UnsetRemoteResolution ¶ added in v2.21.0
type CommandModifier ¶ added in v2.19.0
type CommandModifier func(*Command)
Allow individual commands to be modified from the default client options.
func WithRepoDir ¶ added in v2.19.0
func WithRepoDir(repoDir string) CommandModifier
func WithStderr ¶ added in v2.19.0
func WithStderr(stderr io.Writer) CommandModifier
func WithStdin ¶ added in v2.19.0
func WithStdin(stdin io.Reader) CommandModifier
func WithStdout ¶ added in v2.19.0
func WithStdout(stdout io.Writer) CommandModifier
type NotInstalled ¶
type NotInstalled struct {
// contains filtered or unexported fields
}
func (*NotInstalled) Error ¶
func (e *NotInstalled) Error() string
func (*NotInstalled) Unwrap ¶ added in v2.18.0
func (e *NotInstalled) Unwrap() error
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.