Documentation
¶
Index ¶
- Constants
- Variables
- type CompareResult
- type DiffLayer
- type FileDiff
- type FileStatus
- type GitBranch
- type GitCommit
- type GitFileStatus
- type GitStatus
- type Manager
- func (m *Manager) Branches(ctx context.Context, refresh bool) ([]GitBranch, string, error)
- func (m *Manager) CheckoutBranch(ctx context.Context, name, remote string) error
- func (m *Manager) Close()
- func (m *Manager) Commit(ctx context.Context, message string) (string, error)
- func (m *Manager) Compare(ctx context.Context, base, head string, mergeBase bool) (CompareResult, error)
- func (m *Manager) CreateBranch(ctx context.Context, name string) error
- func (m *Manager) Diff(ctx context.Context, path string, layer DiffLayer) (FileDiff, error)
- func (m *Manager) Diffs(ctx context.Context) ([]FileDiff, error)
- func (m *Manager) Fingerprint(ctx context.Context) uint64
- func (m *Manager) GitStatus(ctx context.Context) (GitStatus, error)
- func (m *Manager) History(ctx context.Context) ([]GitCommit, error)
- func (m *Manager) Pull(ctx context.Context) (string, error)
- func (m *Manager) Push(ctx context.Context) (string, error)
- func (m *Manager) Revert(ctx context.Context, path string) error
- func (m *Manager) Stage(ctx context.Context, paths []string) error
- func (m *Manager) Unstage(ctx context.Context, paths []string) error
Constants ¶
View Source
const EmptyTreeRevision = ":empty"
EmptyTreeRevision is the API-only base used to show the contents introduced by a repository's root commit.
View Source
const WorktreeRevision = ":worktree"
WorktreeRevision is the API-only revision used to compare a commit with the current index and filesystem state. A colon cannot appear in a Git ref name, so it cannot shadow a real branch or tag.
Variables ¶
View Source
var ErrClosed = errors.New("change tracker closed")
View Source
var ErrDirtyWorktree = errors.New("local changes can only move between branches at the same commit; clean the worktree before switching to a divergent branch")
View Source
var ErrNoDiff = errors.New("diff not found")
View Source
var ErrNotGitRepository = errors.New("workspace is not a Git repository")
Functions ¶
This section is empty.
Types ¶
type CompareResult ¶ added in v0.14.2
type FileStatus ¶
type FileStatus int
const ( StatusAdded FileStatus = iota StatusModified StatusDeleted )
type GitFileStatus ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func (*Manager) CheckoutBranch ¶
func (*Manager) Compare ¶ added in v0.14.2
func (m *Manager) Compare(ctx context.Context, base, head string, mergeBase bool) (CompareResult, error)
Compare returns committed file changes from base to head. When mergeBase is true, the base tree is replaced with the commits' common ancestor, matching the three-dot comparison used for pull request file views.
func (*Manager) CreateBranch ¶
Click to show internal directories.
Click to hide internal directories.