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)
| 97 | // first so the worktree starts from the latest remote state. An empty ref is |
| 98 | // ignored, keeping the default HEAD behaviour. |
| 99 | func 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 |
no outgoing calls