Merge pull request #1077 from Atmosphere-Aviation/fix/bd-sync-redirect-handling
fix(sync): Handle redirected beads directories in gitCommitBeadsDir
This commit is contained in:
@@ -209,10 +209,21 @@ func gitCommitBeadsDir(ctx context.Context, message string) error {
|
|||||||
return fmt.Errorf("no .beads directory found")
|
return fmt.Errorf("no .beads directory found")
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get the repository root (handles worktrees properly)
|
// Determine the repository root
|
||||||
repoRoot := getRepoRootForWorktree(ctx)
|
// When beads directory is redirected (bd-arjb), we need to run git commands
|
||||||
if repoRoot == "" {
|
// from the directory containing the actual .beads/, not the current working directory
|
||||||
return fmt.Errorf("cannot determine repository root")
|
var repoRoot string
|
||||||
|
redirectInfo := beads.GetRedirectInfo()
|
||||||
|
if redirectInfo.IsRedirected {
|
||||||
|
// beadsDir is the target (e.g., /path/to/mayor/rig/.beads)
|
||||||
|
// We need to run git from the parent of .beads (e.g., /path/to/mayor/rig)
|
||||||
|
repoRoot = filepath.Dir(beadsDir)
|
||||||
|
} else {
|
||||||
|
// Get the repository root (handles worktrees properly)
|
||||||
|
repoRoot = getRepoRootForWorktree(ctx)
|
||||||
|
if repoRoot == "" {
|
||||||
|
return fmt.Errorf("cannot determine repository root")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Stage only the specific sync-related files
|
// Stage only the specific sync-related files
|
||||||
|
|||||||
Reference in New Issue
Block a user