Skip to content

Add configurable repo/worktree storage root with re-clone flow#306

Closed
PureWeen wants to merge 2 commits intomainfrom
Add-a-way-to-specify-polypilot-clone-root-7299
Closed

Add configurable repo/worktree storage root with re-clone flow#306
PureWeen wants to merge 2 commits intomainfrom
Add-a-way-to-specify-polypilot-clone-root-7299

Conversation

@PureWeen
Copy link
Copy Markdown
Owner

@PureWeen PureWeen commented Mar 8, 2026

Closes #280 - synced with main, conflicts resolved.

This finishes PR #280 (vitek-karas) and incorporates learnings from PR #245.

Summary

  • Add \ConnectionSettings.RepositoryStorageRoot\ and normalize/validate it
  • Update \RepoManager\ to resolve clone/worktree roots from the setting while keeping
    epos.json\ under ~/.polypilot\
  • Preserve existing worktree cleanup behavior by persisting \WorktreeInfo.BareClonePath\
  • Add bulk \RecloneAllRepositoriesToCurrentRootAsync\ and lazy migration for existing repos on new worktree/fetch/branch operations
  • Add Settings UI to pick/reset storage root and trigger 'Re-clone all registered repos in new root'
  • Add unit tests for settings + repo storage behavior

Conflict resolution from merging main

  • Kept both \RepositoryStorageRoot\ (this PR) and \VsCodeVariant Editor\ (main)
  • Kept both \NormalizeRepositoryStorageRoot()\ (this PR) and \NormalizeEnumFields()\ (main)
  • Merged RepoManager: instance-based \ReposDir/\WorktreesDir\ reading from settings + static \SetBaseDirForTesting\ for test isolation
  • Fixed
    epo\ variable scope bug in \RemoveWorktreeAsync\

Closes PR #245

PR #245 implemented the same feature (\RepoStorageDir\ + \SetCustomStorageDir) but this PR has a more complete implementation with re-clone workflow, browse button, and better UX.

Validation

  • \dotnet build\ ✅
  • \dotnet test --filter ConnectionSettingsTests|RepoManagerStorageTests|RepoManagerTests\ ✅ 84/84 passed

vitek-karas and others added 2 commits March 4, 2026 20:19
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…t + VsCodeVariant Editor

- Keep both ConnectionSettings.RepositoryStorageRoot (PR #280) and Editor (main)
- Keep both NormalizeRepositoryStorageRoot (PR #280) and NormalizeEnumFields (main)
- Merge RepoManager: instance-based ReposDir/WorktreesDir (reads from settings)
  with SetBaseDirForTesting static method (for test isolation from main)
- Keep Load() BackfillWorktreeClonePaths AND _loadedSuccessfully = true
- Fix duplicate else-if and repo variable scope issue in RemoveWorktreeAsync

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@PureWeen PureWeen closed this Mar 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants