Skip to content

Allow configuring custom storage location for cloned repositories#245

Closed
Copilot wants to merge 2 commits intomainfrom
copilot/feature-change-repository-location
Closed

Allow configuring custom storage location for cloned repositories#245
Copilot wants to merge 2 commits intomainfrom
copilot/feature-change-repository-location

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 28, 2026

Users on Windows DevDrive (or any non-default code storage location) had no way to redirect where PolyPilot stores bare repo clones and worktrees — everything went to ~/.polypilot/repos and ~/.polypilot/worktrees, potentially consuming large amounts of profile-directory space.

Changes

ConnectionSettings — new RepoStorageDir property

  • Nullable string; null = use default ~/.polypilot
  • Persists to settings.json via existing serialization

RepoManager — custom storage dir support

  • SetCustomStorageDir(string? path) — applies override, invalidates cached paths
  • GetEffectiveStorageDir() — returns the active storage root (testable)
  • GetReposDir() / GetWorktreesDir() now resolve under RepoStorageDir when set; state file (repos.json) stays in ~/.polypilot
  • SetBaseDirForTesting() also clears _customStorageDir to preserve test isolation

MauiProgram — apply at startup

try { RepoManager.SetCustomStorageDir(ConnectionSettings.Load().RepoStorageDir); } catch { }

Applied before any RepoManager access; failure is non-fatal (falls back to default).

Settings UI — new "Repositories" group

  • Text input for custom path + Save button
  • Creates the directory if it doesn't exist (surfaces IOException message on failure)
  • Applies to RepoManager immediately on save; searchable via keywords repo storage location clone directory path devdrive
  • Note in UI: existing repos retain their current BareClonePath; only newly cloned repos use the new location

Tests

  • 3 new RepoManagerTests covering SetCustomStorageDir edge cases (null, whitespace, valid path)
  • 3 new ConnectionSettingsTests covering RepoStorageDir default and serialization round-trips

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • 192.0.2.1
    • Triggering command: /usr/share/dotnet/dotnet /usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/PolyPilot/PolyPilot/PolyPilot.Tests/bin/Debug/net10.0/PolyPilot.Tests.runtimeconfig.json --depsfile /home/REDACTED/work/PolyPilot/PolyPilot/PolyPilot.Tests/bin/Debug/net10.0/PolyPilot.Tests.deps.json /home/REDACTED/work/PolyPilot/PolyPilot/PolyPilot.Tests/bin/Debug/net10.0/testhost.dll --port 46355 --endpoint 127.0.0.1:046355 --role client --parentprocessid 4377 --telemetryoptedin false (packet block)
  • imzvsblobprodcus368.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet dotnet restore --no-dependencies /tmp/codeql-scratch-abbd4936ea2bb08e/dbs/csharp/working/622A4908CDBE24FF535A100F8AC55E4F/missingpackages_workingdir --packages /tmp/codeql-scratch-abbd4936ea2bb08e/dbs/csharp/working/missingpackages /p:DisableImplicitNuGetFallbackFolder=true --verbosity normal --configfile /tmp/codeql-scratch-abbd4936ea2bb08e/dbs/csharp/working/nugetconfig/nuget.config --force (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>[Feature request] Allow changing location of cloned repositories</issue_title>
<issue_description>## Description
Allow changing location of cloned repositories, and/or adding already existing repositories to the list

I am using DevDrive to store all my code at D:/, I don't want PolyPilot to store 10s of GB of data to my profile directory.</issue_description>

Comments on the Issue (you are @copilot in this section)


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

- Add `RepoStorageDir` property to `ConnectionSettings`
- Add `SetCustomStorageDir()` and `GetEffectiveStorageDir()` to `RepoManager`
- Apply custom storage dir at app startup in `MauiProgram.cs`
- Add 'Repositories' settings group in Settings.razor with path input
- Add `.repo-storage-row` CSS style
- Add 6 new tests for the new behavior

Co-authored-by: PureWeen <5375137+PureWeen@users.noreply.github.com>
Copilot AI changed the title [WIP] Add option to change location of cloned repositories Allow configuring custom storage location for cloned repositories Feb 28, 2026
@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.

[Feature request] Allow changing location of cloned repositories

2 participants