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:
@@ -67,7 +67,7 @@ This command:
|
||||
}
|
||||
|
||||
// Find .beads directory
|
||||
beadsDir := findBeadsDir()
|
||||
beadsDir := beads.FindBeadsDir()
|
||||
if beadsDir == "" {
|
||||
if jsonOutput {
|
||||
outputJSON(map[string]interface{}{
|
||||
@@ -729,7 +729,7 @@ func cleanupWALFiles(dbPath string) {
|
||||
// handleInspect shows migration plan and database state for AI agent analysis
|
||||
func handleInspect() {
|
||||
// Find .beads directory
|
||||
beadsDir := findBeadsDir()
|
||||
beadsDir := beads.FindBeadsDir()
|
||||
if beadsDir == "" {
|
||||
if jsonOutput {
|
||||
outputJSON(map[string]interface{}{
|
||||
@@ -927,7 +927,7 @@ func handleToSeparateBranch(branch string, dryRun bool) {
|
||||
}
|
||||
|
||||
// Find .beads directory
|
||||
beadsDir := findBeadsDir()
|
||||
beadsDir := beads.FindBeadsDir()
|
||||
if beadsDir == "" {
|
||||
if jsonOutput {
|
||||
outputJSON(map[string]interface{}{
|
||||
|
||||
Reference in New Issue
Block a user