MCPcopy Index your code
hub / github.com/docker/docker-agent / WithBase

Function WithBase

pkg/worktree/worktree.go:99–101  ·  view source on GitHub ↗

WithBase branches the worktree from ref instead of the repository's current HEAD. ref is any revision git understands (a branch, tag, commit, or remote-tracking ref like "origin/main"). A remote-tracking ref is fetched first so the worktree starts from the latest remote state. An empty ref is ignore

(ref string)

Source from the content-addressed store, hash-verified

97// first so the worktree starts from the latest remote state. An empty ref is
98// ignored, keeping the default HEAD behaviour.
99func WithBase(ref string) CreateOption {
100 return func(c *createConfig) { c.base = strings.TrimSpace(ref) }
101}
102
103// WithRoot places the worktree under dir instead of the default data
104// directory. The worktree is created at <dir>/worktrees/<name>. An empty dir

Calls

no outgoing calls