fix: Auto-configure sync.branch during bd init (bd-flil)

- bd init now auto-sets sync.branch to current git branch
- Fixes 'bd sync --status' error after fresh bd init
- Changed all branch detection to use 'git symbolic-ref' instead of 'git rev-parse' to work in fresh repos without commits
- Updated init.go, init_team.go, sync.go, version.go

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Steve Yegge
2025-11-23 19:38:44 -08:00
parent 7e7d1dd702
commit a4c38d53b4
5 changed files with 184 additions and 81 deletions

View File

@@ -188,13 +188,14 @@ func runTeamWizard(ctx context.Context, store storage.Storage) error {
}
// getGitBranch returns the current git branch name
// Uses symbolic-ref instead of rev-parse to work in fresh repos without commits (bd-flil)
func getGitBranch() (string, error) {
cmd := exec.Command("git", "rev-parse", "--abbrev-ref", "HEAD")
cmd := exec.Command("git", "symbolic-ref", "--short", "HEAD")
output, err := cmd.Output()
if err != nil {
return "", err
}
return strings.TrimSpace(string(output)), nil
}