Skip to content

perf: use lightweight worktree loader for cd interactive mode#173

Merged
raphi011 merged 1 commit into
mainfrom
perf/lightweight-cd-loader
Apr 10, 2026
Merged

perf: use lightweight worktree loader for cd interactive mode#173
raphi011 merged 1 commit into
mainfrom
perf/lightweight-cd-loader

Conversation

@raphi011

Copy link
Copy Markdown
Owner

wt cd -i was calling LoadWorktreesForRepos which runs 4 git commands per repo (git worktree list, git config, git remote get-url, git show). The CD wizard only needs path, branch, and repo name — all from a single git worktree list call. The other 3 commands were completely unused, wasting 3N git subprocess spawns for N registered repos.

Adds ListWorktreesForRepos — a lightweight parallel loader that only calls git worktree list per repo — and switches cd -i to use it.

Breaking Changes

None

Test Coverage

  • Unit tests added: 2 (TestListWorktreesForRepos, TestListWorktreesForRepos_BadRepo)
  • Integration tests added: 0

🤖 Generated with Claude Code

`wt cd -i` was calling LoadWorktreesForRepos which runs 4 git commands
per repo (worktree list, branch config, origin URL, commit metadata).
The CD wizard only needs path, branch, and repo name — all from a
single `git worktree list` call. The other 3 commands were wasted.

Add ListWorktreesForRepos — a lightweight parallel loader that only
calls `git worktree list` per repo. Switch cd interactive mode to use
it, eliminating 3N unnecessary git subprocess spawns for N repos.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@codecov

codecov Bot commented Apr 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.87500% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
cmd/wt/cd_cmd.go 0.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@raphi011
raphi011 merged commit 3a8176a into main Apr 10, 2026
2 checks passed
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.

1 participant