diff --git a/cmd/bd/init_team.go b/cmd/bd/init_team.go index b5092c8e..1232611c 100644 --- a/cmd/bd/init_team.go +++ b/cmd/bd/init_team.go @@ -10,6 +10,7 @@ import ( "github.com/steveyegge/beads/internal/config" "github.com/steveyegge/beads/internal/storage" + "github.com/steveyegge/beads/internal/syncbranch" "github.com/steveyegge/beads/internal/ui" ) @@ -71,8 +72,8 @@ func runTeamWizard(ctx context.Context, store storage.Storage) error { fmt.Printf("\n%s Sync branch set to: %s\n", ui.RenderPass("✓"), syncBranch) - // Set sync.branch config - if err := store.SetConfig(ctx, "sync.branch", syncBranch); err != nil { + // Set sync.branch config (GH#923: use syncbranch.Set for validation) + if err := syncbranch.Set(ctx, store, syncBranch); err != nil { return fmt.Errorf("failed to set sync branch: %w", err) } diff --git a/cmd/bd/migrate.go b/cmd/bd/migrate.go index 90f233fd..927d2c25 100644 --- a/cmd/bd/migrate.go +++ b/cmd/bd/migrate.go @@ -12,6 +12,7 @@ import ( "github.com/steveyegge/beads/internal/beads" "github.com/steveyegge/beads/internal/configfile" "github.com/steveyegge/beads/internal/storage/sqlite" + "github.com/steveyegge/beads/internal/syncbranch" "github.com/steveyegge/beads/internal/types" "github.com/steveyegge/beads/internal/ui" "github.com/steveyegge/beads/internal/utils" @@ -933,8 +934,8 @@ func handleToSeparateBranch(branch string, dryRun bool) { return } - // Update sync.branch config - if err := store.SetConfig(ctx, "sync.branch", b); err != nil { + // Update sync.branch config (GH#923: use syncbranch.Set for validation) + if err := syncbranch.Set(ctx, store, b); err != nil { if jsonOutput { outputJSON(map[string]interface{}{ "error": "config_update_failed",