Tests were failing because beads.FindDatabasePath() follows the
project's .beads/redirect file, causing tests to find unexpected
databases. Fixed by:
- Setting BEADS_DIR in tests that need isolation from git repo detection
- Clearing BEADS_DIR in TestMain to prevent global contamination
- Updating migration test schema to include owner column
This ensures tests work correctly in crew directories that have
redirect files pointing to shared .beads directories.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Executed-By: beads/crew/dave
Rig: beads
Role: crew
Problem:
- Sync branch configuration was not consistently saved across storage types
- State divergence between database and config.yaml files
Solution:
- Update Set to write configuration to both yaml and database backends
- Add regression test for yaml configuration persistence
Impact:
- Guarantees configuration consistency across system reboots
- Prevents sync settings from being lost when reading from yaml
- Add TestSet cases for main/master rejection in syncbranch_test.go
- Add TestInitWithSyncBranch to verify --branch flag works
- Add TestInitWithoutBranchFlag to verify no auto-detection (root cause)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Two issues fixed:
1. `bd init` was auto-detecting current branch (e.g., main) as sync.branch
when no --branch flag was specified. This caused worktree conflicts.
2. Added validation to reject main/master as sync.branch values.
When sync.branch is set to main, the worktree mechanism creates a checkout
of main at .git/beads-worktrees/main/, which prevents git checkout main
from working in the user's working directory.
The sync branch feature should use a dedicated branch like 'beads-sync'.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Executed-By: beads/crew/dave
Rig: beads
Role: crew
Multiple test files were still using the old sqlite.New(path) signature
instead of the new sqlite.New(ctx, path) signature. This was causing
compilation failures in the test suite.
Fixed files:
- internal/importer/importer_test.go
- internal/importer/external_ref_test.go
- internal/importer/timestamp_test.go
- internal/rpc/limits_test.go
- internal/rpc/list_filters_test.go
- internal/rpc/rpc_test.go
- internal/rpc/status_test.go
- internal/syncbranch/syncbranch_test.go
- Created internal/syncbranch package with validation and env var support
- Added --branch flag to bd init command
- Enhanced bd config get/set to validate sync.branch
- Added BEADS_SYNC_BRANCH environment variable support
- Comprehensive tests for branch name validation
- Supports precedence: env var > database config > empty (current branch)