refactor: consolidate duplicate path-finding utilities (bd-74w1, bd-4nqq)

- Add git.GetRepoRoot() with Windows path normalization
- Update beads.findGitRoot() to delegate to git.GetRepoRoot()
- Replace findBeadsDir() with beads.FindBeadsDir() across 8 files
- Remove duplicate findBeadsDir() and findGitRoot() function definitions
- Remove dead test code (TestInfoCommand, TestInfoWithNoDaemon)
- Update tests to work with consolidated APIs

Part of Code Health Review Dec 2025 epic (bd-tggf).

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Steve Yegge
2025-12-22 21:15:41 -08:00
parent ca1927bfaa
commit fc0b98730a
10 changed files with 77 additions and 107 deletions

View File

@@ -7,6 +7,7 @@ import (
"strings"
"github.com/steveyegge/beads/internal/debug"
"github.com/steveyegge/beads/internal/git"
)
// ensureForkProtection prevents contributors from accidentally committing
@@ -16,8 +17,8 @@ import (
// .beads/issues.jsonl to .git/info/exclude so it won't be staged.
// This is a per-clone setting that doesn't modify tracked files.
func ensureForkProtection() {
// Find git root (reuses existing findGitRoot from autoimport.go)
gitRoot := findGitRoot()
// Find git root
gitRoot := git.GetRepoRoot()
if gitRoot == "" {
return // Not in a git repo
}