Documentation
¶
Overview ¶
Package worktreeadapter implements configured git repository and worktree operations for the Copilot adapter.
Index ¶
- type Config
- type WorktreeManager
- func (manager *WorktreeManager) Changes(ctx context.Context, path string) (copilotadapter.WorktreeChanges, error)
- func (manager *WorktreeManager) Inspect(ctx context.Context, path string) (copilotadapter.WorktreeSnapshot, error)
- func (manager *WorktreeManager) Prepare(ctx context.Context, request copilotadapter.WorktreeRequest) (copilotadapter.PreparedWorktree, error)
- func (manager *WorktreeManager) Release(ctx context.Context, worktree copilotadapter.PreparedWorktree) error
- func (manager *WorktreeManager) Repositories() []copilotadapter.Repository
- func (manager *WorktreeManager) Reuse(ctx context.Context, repositoryID string, path string) (copilotadapter.PreparedWorktree, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Repositories []copilotadapter.Repository
WorktreeRoot string
PatchBytes int
}
Config declares the only repository roots the browser may select.
type WorktreeManager ¶
type WorktreeManager struct {
// contains filtered or unexported fields
}
WorktreeManager is the concrete git/filesystem boundary.
func NewWorktreeManager ¶
func NewWorktreeManager(config Config) (*WorktreeManager, error)
NewWorktreeManager validates repository roots and the managed-worktree root.
func (*WorktreeManager) Changes ¶
func (manager *WorktreeManager) Changes(ctx context.Context, path string) (copilotadapter.WorktreeChanges, error)
Changes returns porcelain file states and a bounded binary-capable patch.
func (*WorktreeManager) Inspect ¶
func (manager *WorktreeManager) Inspect(ctx context.Context, path string) (copilotadapter.WorktreeSnapshot, error)
Inspect returns fresh git metadata or a missing state when the path vanished.
func (*WorktreeManager) Prepare ¶
func (manager *WorktreeManager) Prepare(ctx context.Context, request copilotadapter.WorktreeRequest) (copilotadapter.PreparedWorktree, error)
Prepare validates the ref and creates a managed git worktree by default.
func (*WorktreeManager) Release ¶
func (manager *WorktreeManager) Release(ctx context.Context, worktree copilotadapter.PreparedWorktree) error
Release removes only an adapter-managed path beneath the configured root.
func (*WorktreeManager) Repositories ¶
func (manager *WorktreeManager) Repositories() []copilotadapter.Repository
Repositories returns a defensive copy of configured roots.
func (*WorktreeManager) Reuse ¶
func (manager *WorktreeManager) Reuse(ctx context.Context, repositoryID string, path string) (copilotadapter.PreparedWorktree, error)
Reuse accepts only the configured checkout or a path Git reports as one of that repository's worktrees beneath the managed root. The path comes from server persistence, but legacy rows are deliberately treated as untrusted.