Documentation
¶
Index ¶
- Variables
- type Branch
- type Branches
- type Client
- func (c *Client) Branches(ctx context.Context, startDir string) (Branches, error)
- func (c *Client) Diff(ctx context.Context, opts DiffOptions) (Diff, error)
- func (c *Client) Log(ctx context.Context, startDir string, limit int) (Log, error)
- func (c *Client) Mutate(ctx context.Context, opts MutationOptions) (MutationResult, error)
- func (c *Client) RepositoryRoot(ctx context.Context, startDir string) (string, error)
- func (c *Client) Status(ctx context.Context, startDir string) (Status, error)
- type Commit
- type Diff
- type DiffOptions
- type Log
- type MutationAction
- type MutationOptions
- type MutationResult
- type Remote
- type Status
- type StatusFile
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotRepository = errors.New("not a git repository")
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct{}
func (*Client) Mutate ¶ added in v0.31.109
func (c *Client) Mutate(ctx context.Context, opts MutationOptions) (MutationResult, error)
func (*Client) RepositoryRoot ¶
type DiffOptions ¶
type MutationAction ¶ added in v0.31.109
type MutationAction string
const ( MutationStage MutationAction = "stage" MutationUnstage MutationAction = "unstage" MutationDiscard MutationAction = "discard" MutationCommit MutationAction = "commit" MutationSwitchBranch MutationAction = "switch_branch" )
type MutationOptions ¶ added in v0.31.109
type MutationOptions struct {
StartDir string
Action MutationAction
Path string
Branch string
Message string
}
type MutationResult ¶ added in v0.31.109
type MutationResult struct {
IsGit bool `json:"is_git"`
Root string `json:"root"`
Action MutationAction `json:"action"`
Path string `json:"path,omitempty"`
Branch string `json:"branch,omitempty"`
Message string `json:"message,omitempty"`
Destructive bool `json:"destructive,omitempty"`
Output string `json:"output,omitempty"`
}
type StatusFile ¶
type StatusFile struct {
Path string `json:"path"`
OldPath string `json:"old_path,omitempty"`
Index string `json:"index,omitempty"`
Worktree string `json:"worktree,omitempty"`
Status string `json:"status"`
Staged bool `json:"staged"`
Unstaged bool `json:"unstaged"`
Untracked bool `json:"untracked,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.