Add debug logging for YAML parse errors in autoimport (bd-mql4)

When config.yaml has malformed YAML, getLocalSyncBranch and
isNoDbModeConfigured were silently returning empty/false with no
feedback, making debugging difficult. Now they log a warning via
debug.Logf when YAML parsing fails.

🤖 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-30 16:50:06 -08:00
parent eae4e9f11e
commit 8eccc3d4f1
2 changed files with 843 additions and 843 deletions

View File

@@ -12,6 +12,7 @@ import (
"strings"
"github.com/steveyegge/beads/internal/beads"
"github.com/steveyegge/beads/internal/debug"
"github.com/steveyegge/beads/internal/git"
"github.com/steveyegge/beads/internal/storage"
"github.com/steveyegge/beads/internal/syncbranch"
@@ -173,6 +174,7 @@ func isNoDbModeConfigured(beadsDir string) bool {
var cfg localConfig
if err := yaml.Unmarshal(data, &cfg); err != nil {
debug.Logf("Warning: failed to parse config.yaml for no-db check: %v", err)
return false
}
@@ -198,6 +200,7 @@ func getLocalSyncBranch(beadsDir string) string {
// Parse YAML properly to handle edge cases (comments, indentation, special chars)
var cfg localConfig
if err := yaml.Unmarshal(data, &cfg); err != nil {
debug.Logf("Warning: failed to parse config.yaml for sync-branch: %v", err)
return ""
}