worktrees

package
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 18, 2026 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	// contains filtered or unexported fields
}

func NewAPI

func NewAPI(manager *worktree.Manager) *API

func (*API) Create

func (api *API) Create(ctx context.Context, requester interface{}, request *CreateRequest) (*CreateResponse, error)

func (*API) Delete

func (api *API) Delete(ctx context.Context, requester interface{}, request *DeleteRequest) (*DeleteResponse, error)

func (*API) List

func (api *API) List(ctx context.Context, requester interface{}, request *ListRequest) (*ListResponse, error)

type CreateRequest

type CreateRequest struct {
	Repo   string `json:"repo"`
	Branch string `json:"branch"`
	Base   string `json:"base,omitempty"`
}

func (*CreateRequest) Validate

func (r *CreateRequest) Validate() error

type CreateResponse

type CreateResponse struct {
	Path    string `json:"path"`
	Branch  string `json:"branch"`
	Created bool   `json:"created"`
}

type DeleteRequest

type DeleteRequest struct {
	Repo  string `json:"repo"`
	Path  string `json:"path"`
	Force bool   `json:"force,omitempty"`
}

func (*DeleteRequest) Validate

func (r *DeleteRequest) Validate() error

type DeleteResponse

type DeleteResponse struct {
	Removed string `json:"removed"`
}

type ListRequest

type ListRequest struct {
	Repo string `json:"repo"`
	// Fetch refreshes origin refs first, so remote branches are current.
	Fetch bool `json:"fetch,omitempty"`
}

func (*ListRequest) Validate

func (r *ListRequest) Validate() error

type ListResponse

type ListResponse struct {
	// Exists reports whether the path is a directory at all — the UI
	// uses it to validate a project path before adding it.
	Exists    bool              `json:"exists"`
	IsGit     bool              `json:"is_git"`
	Repo      string            `json:"repo,omitempty"`
	Worktrees []worktree.Info   `json:"worktrees"`
	Branches  []worktree.Branch `json:"branches,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL