Commit Graph

2 Commits

Author SHA1 Message Date
Steve Yegge
d74a14d92a test(sync): add tests for redirect handling in git status checks
Add tests for gitHasBeadsChanges and gitHasUncommittedBeadsChanges
functions when .beads directory is redirected to another repo:

- Test non-redirected case (baseline functionality)
- Test redirected case with no changes (clean target repo)
- Test redirected case with changes (modified file in target)

These tests cover the redirect detection logic added in a61cbde6
that uses `git -C <targetRepoDir>` when beadsDir is redirected.

Closes: bd-hxcf

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-10 21:31:24 -08:00
ruby
32aea46ca6 test(sync): add unit tests for gitHasUncommittedBeadsChanges (bd-p7i2)
Extract parseGitStatusForBeadsChanges helper function from
gitHasUncommittedBeadsChanges to enable unit testing without git setup.

Add 14 test cases covering:
- Empty/no changes
- Modified files (staged, unstaged, both)
- Added files (staged, with modifications)
- Untracked files (should return false)
- Deleted files (should return false)
- Renamed/copied files
- Edge cases (short status line)

Part of GH#885 follow-up.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-04 16:22:20 -08:00