666
return { ok: false, reason };
667
}
669
>
await fs.mkdir(URI.joinPath(worktreePath, '..').fsPath, { recursive: true });
670
>
await this._gitService.addExistingWorktree(repositoryRoot, worktreePath, branchName);
671
>
this._createdWorktrees.set(sessionId, { repositoryRoot, worktree: worktreePath });
672
>
this._logService.info(`[${this._logLabel}:${sessionId}] Recreated worktree '${worktreePath.fsPath}'`);
673
>
return { ok: true };
674
>
} catch (error) {
675
const reason = errorMessage(error);
676
this._logService.warn(`[${this._logLabel}:${sessionId}] Failed to recreate worktree '${worktreePath.fsPath}': ${reason}`);