Fixed TestHashIDs_IdenticalContentDedup test failure by removing duplicate
--json flag definitions that were shadowing the global persistent flag.
Root cause: Commands had both a persistent --json flag (main.go) and local
--json flags (in individual command files). The local flags shadowed the
persistent flag, preventing jsonOutput variable from being set correctly.
Changes:
- Removed 31 duplicate --json flag definitions from 15 command files
- All commands now use the single persistent --json flag from main.go
- Commands now correctly output JSON when --json flag is specified
Test results:
- TestHashIDs_IdenticalContentDedup: Now passes (was failing)
- TestHashIDs_MultiCloneConverge: Passes without JSON parsing warnings
- All other tests: Pass with no regressions
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Renamed config.json to metadata.json to clarify purpose (database metadata)
- Fixed config.yaml/config.json conflict by making Viper explicitly load only config.yaml
- Added automatic migration from config.json to metadata.json on first read
- Fixed jsonOutput variable shadowing across 22 command files
- Updated bd init to create both metadata.json and config.yaml template
- Fixed 5 failing JSON output tests
- All tests passing
Resolves config file confusion and makes config.yaml work correctly.
Closes#178 (global flags), addresses config issues from #193
Amp-Thread-ID: https://ampcode.com/threads/T-e6ac8192-e18f-4ed7-83bc-4a5986718bb7
Co-authored-by: Amp <amp@ampcode.com>
Fixed all unchecked error returns in production code:
- os.Remove() calls in cleanup paths
- cmd.Wait() in goroutines
- fmt.Fprintf() writes
- Type assertions with proper ok checks
Reduces linter issues from 99 to 88. CI should now pass linting.
- Added mergeResult struct to track operations (added vs skipped)
- Check if source issues already closed before attempting to close
- Track dependencies migrated vs already existed
- Count text references updated
- Display detailed breakdown of operations in output
- Updated help text to clarify idempotent behavior
- Added comprehensive tests for idempotent retry scenarios
- Add performMerge() with dependency migration in both directions
- Implement updateMergeTextReferences() for text reference updates
- Close source issues with 'Merged into bd-X' reason
- Fix store initialization panic by checking daemon mode earlier
- Add TODO for transaction support (deferred, see bd-215 for idempotency approach)
Closes bd-202, bd-193, bd-194, bd-195, bd-196
Related: bd-190 (merge epic), bd-215 (idempotency enhancement)
Amp-Thread-ID: https://ampcode.com/threads/T-30fe297d-4713-4f84-abc9-3bd264caa4c6
Co-authored-by: Amp <amp@ampcode.com>