fix: worktree path stays under workspace, not inside project repo
repoRoot is used for git operations only. The worktree directory lives under ai.Workspace/.picoclaw/worktrees/ to avoid polluting the user's project with a .picoclaw directory. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
1e5926ee35
commit
bbc3dea9ed
1 changed files with 2 additions and 2 deletions
|
|
@ -208,7 +208,7 @@ func resolvePlanFallbacks(agentCfg *config.AgentConfig, defaults *config.AgentDe
|
|||
// ActivateWorktree creates a worktree for a session.
|
||||
// projectDir is the git repository to create the worktree in.
|
||||
// If empty, falls back to ai.Workspace.
|
||||
// Path: <projectDir>/.picoclaw/worktrees/<branch-basename>/
|
||||
// Worktree path: <workspace>/.picoclaw/worktrees/<branch-basename>/
|
||||
func (ai *AgentInstance) ActivateWorktree(sessionKey, taskName, projectDir string) (*git.WorktreeInfo, error) {
|
||||
if projectDir == "" {
|
||||
projectDir = ai.Workspace
|
||||
|
|
@ -220,7 +220,7 @@ func (ai *AgentInstance) ActivateWorktree(sessionKey, taskName, projectDir strin
|
|||
|
||||
branchName := git.SanitizeBranchName(taskName)
|
||||
baseName := git.BranchBaseName(branchName)
|
||||
wtPath := filepath.Join(repoRoot, ".picoclaw", "worktrees", baseName)
|
||||
wtPath := filepath.Join(ai.Workspace, ".picoclaw", "worktrees", baseName)
|
||||
|
||||
wt, err := git.CreateWorktree(repoRoot, wtPath, branchName)
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue