resolveCreateConfig applies opts on top of the defaults. The worktrees root defaults to the data directory; [WithRoot] overrides it (mainly for tests and embedders that need an isolated location).
(opts []CreateOption)
| 84 | // defaults to the data directory; [WithRoot] overrides it (mainly for tests |
| 85 | // and embedders that need an isolated location). |
| 86 | func resolveCreateConfig(opts []CreateOption) createConfig { |
| 87 | cfg := createConfig{root: paths.GetDataDir()} |
| 88 | for _, opt := range opts { |
| 89 | opt(&cfg) |
| 90 | } |
| 91 | return cfg |
| 92 | } |
| 93 | |
| 94 | // WithBase branches the worktree from ref instead of the repository's current |
| 95 | // HEAD. ref is any revision git understands (a branch, tag, commit, or |
no test coverage detected