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:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user