fix: prevent .beads/redirect from being committed (GH#814)

- Add redirect to GitignoreTemplate with explanatory comment
- Add redirect to requiredPatterns for outdated gitignore detection
- Add CheckRedirectNotTracked() to detect already-tracked redirect files
- Add FixRedirectTracking() to untrack via git rm --cached
- Register check in bd doctor under Git Integration category
- Add 6 tests for the new functionality

The redirect file contains a relative path that only works in the
original worktree. When committed, it causes warnings in other clones:
"Warning: redirect target does not exist"

🤖 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 18:27:18 -08:00
parent 584608a14e
commit 310d374264
4 changed files with 298 additions and 404 deletions

View File

@@ -225,7 +225,7 @@ func applyFixList(path string, fixes []doctorCheck) {
switch check.Name {
case "Gitignore":
err = doctor.FixGitignore()
case "Redirect Not Tracked":
case "Redirect Tracking":
err = doctor.FixRedirectTracking()
case "Git Hooks":
err = fix.GitHooks(path)