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:
@@ -151,7 +151,8 @@ func resolveBranch() string {
|
||||
}
|
||||
|
||||
// Fallback: try to get branch from git at runtime
|
||||
cmd := exec.Command("git", "rev-parse", "--abbrev-ref", "HEAD")
|
||||
// Use symbolic-ref to work in fresh repos without commits (bd-flil)
|
||||
cmd := exec.Command("git", "symbolic-ref", "--short", "HEAD")
|
||||
cmd.Dir = "."
|
||||
if output, err := cmd.Output(); err == nil {
|
||||
if branch := strings.TrimSpace(string(output)); branch != "" && branch != "HEAD" {
|
||||
|
||||
Reference in New Issue
Block a user