Files
beads/internal
Steve Yegge 32c803dd16 fix(worktree): Cache git detection results to eliminate slowness (bd-7di)
In git worktrees, any bd command was slow with a 2-3s pause because:
- git.IsWorktree() was called 4+ times per command
- Each call spawned 2 git processes (git-dir and git-common-dir)
- git.GetRepoRoot() and git.GetMainRepoRoot() also called multiple times

Fix: Cache results using sync.Once since these values do not change during
a single command execution:
- IsWorktree() - caches worktree detection
- GetRepoRoot() - caches repo root path
- GetMainRepoRoot() - caches main repo root for worktrees

Added ResetCaches() for test cleanup between subtests that change directories.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-25 22:04:40 -08:00
..
2025-12-24 00:06:41 -08:00
2025-12-24 00:06:41 -08:00