fix: set git index flags on init when sync-branch is configured (#1158)
Fresh clones with sync-branch configured in .beads/config.yaml would show .beads/issues.jsonl as modified in git status because the git index flags (skip-worktree, assume-unchanged) are local-only and don't transfer via clone. This fix ensures bd init sets these flags in two scenarios: 1. `bd init --branch <name>` - when user explicitly sets sync branch 2. `bd init` on cloned repo - when sync-branch already exists in config.yaml Added SetSyncBranchGitignoreFlags() helper and two tests for coverage.
This commit is contained in:
@@ -683,3 +683,10 @@ func FixSyncBranchGitignore() error {
|
||||
|
||||
return fix.SyncBranchGitignore(cwd)
|
||||
}
|
||||
|
||||
// SetSyncBranchGitignoreFlags sets git index flags on .beads/*.jsonl files.
|
||||
// This is called directly by init when --branch is specified, bypassing the
|
||||
// GetFromYAML() check since the in-memory config may not be updated yet.
|
||||
func SetSyncBranchGitignoreFlags(path string) error {
|
||||
return fix.SyncBranchGitignore(path)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user