Description
Add to MacApp/Packages/WorktreeManager/Sources/WorktreeManager/GitCLI.swift:
func listRemotes(in repoPath: URL) async throws -> [GitRemoteEntry]
Implementation: run git remote -v, parse lines of form <name><TAB><url> (fetch|push). Keep only (fetch) rows, deduplicate by name.
In WorktreeFeature.State:
public var remotes: [GitRemoteEntry] = []
In .loadProject reducer flow, after loading worktrees, call gitCLI.listRemotes(in: project.path) → write to state.remotes. On unload → state.remotes = [].
Cap (rate-limit guard): if parsed list contains more than 20 entries with host == "github.com" (via GitRemote.parse), truncate github entries to first 20; keep all non-github entries.
Unit tests: empty output, single origin, multiple remotes, fetch+push dedup, non-github preserved, cap behavior.
Spec reference
See swarm-report/github-integration-decomposition.md#t-4. Cap=20 is a BA-review-driven rate-limit guard.
Relationships
Acceptance criteria
Complexity
M
Suggested agent
developer-workflow:swift-engineer
Module / Layer
WorktreeManager / Git integration
Description
Add to
MacApp/Packages/WorktreeManager/Sources/WorktreeManager/GitCLI.swift:Implementation: run
git remote -v, parse lines of form<name><TAB><url> (fetch|push). Keep only(fetch)rows, deduplicate byname.In
WorktreeFeature.State:In
.loadProjectreducer flow, after loading worktrees, callgitCLI.listRemotes(in: project.path)→ write tostate.remotes. On unload →state.remotes = [].Cap (rate-limit guard): if parsed list contains more than 20 entries with
host == "github.com"(viaGitRemote.parse), truncate github entries to first 20; keep all non-github entries.Unit tests: empty output, single origin, multiple remotes, fetch+push dedup, non-github preserved, cap behavior.
Spec reference
See
swarm-report/github-integration-decomposition.md#t-4. Cap=20 is a BA-review-driven rate-limit guard.Relationships
Acceptance criteria
git remote -vwithorigin (fetch)+origin (push)→ singleGitRemoteEntryWorktreeFeature.State.remotespopulated on.loadProject, cleared on unloadTestStore:.loadProject→state.remotes == expectedEntriesWorktreeManagerTestscover all parse casesWorktreeManagertests still passComplexity
M
Suggested agent
developer-workflow:swift-engineerModule / Layer
WorktreeManager/ Git integration