Documentation
¶
Index ¶
- Variables
- type Branch
- type Branches
- type Client
- func (c *Client) Branches(ctx context.Context, startDir string) (Branches, error)
- func (c *Client) CommitDetail(ctx context.Context, startDir, hash string) (CommitDetail, 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)
- func (c *Client) Worktrees(ctx context.Context, startDir string) (Worktrees, error)
- type Commit
- type CommitDetail
- type CommitFile
- type Diff
- type DiffOptions
- type Log
- type MutationAction
- type MutationOptions
- type MutationResult
- type Remote
- type Status
- type StatusFile
- type Worktree
- type Worktrees
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) CommitDetail ¶ added in v0.31.154
func (*Client) Mutate ¶ added in v0.31.109
func (c *Client) Mutate(ctx context.Context, opts MutationOptions) (MutationResult, error)
func (*Client) RepositoryRoot ¶
type CommitDetail ¶ added in v0.31.154
type CommitDetail struct {
IsGit bool `json:"is_git"`
Root string `json:"root"`
Hash string `json:"hash"`
ShortHash string `json:"short_hash"`
Author string `json:"author,omitempty"`
Email string `json:"email,omitempty"`
Date string `json:"date,omitempty"`
Parents []string `json:"parents,omitempty"`
Subject string `json:"subject"`
Body string `json:"body,omitempty"`
Files []CommitFile `json:"files"`
}
type CommitFile ¶ added in v0.31.154
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" MutationCheckoutCommit MutationAction = "checkout_commit" MutationWorktreeAdd MutationAction = "worktree_add" MutationWorktreeRemove MutationAction = "worktree_remove" MutationFetch MutationAction = "fetch" )
type MutationOptions ¶ added in v0.31.109
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"`
Hash string `json:"hash,omitempty"`
WorktreePath string `json:"worktree_path,omitempty"`
NewBranch string `json:"new_branch,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"`
}
type Worktree ¶ added in v0.31.154
type Worktree struct {
Path string `json:"path"`
Head string `json:"head,omitempty"`
Branch string `json:"branch,omitempty"`
Detached bool `json:"detached,omitempty"`
Locked bool `json:"locked,omitempty"`
LockReason string `json:"lock_reason,omitempty"`
Prunable bool `json:"prunable,omitempty"`
PruneReason string `json:"prune_reason,omitempty"`
Bare bool `json:"bare,omitempty"`
Current bool `json:"current,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.