Merge remote-tracking branch 'origin/main' into fix-jj-detached-head-upstream-check

# Conflicts:
#	cmd/bd/sync_git_test.go
This commit is contained in:
Phredrick Phool
2026-01-12 06:49:26 -06:00
205 changed files with 9409 additions and 1305 deletions

View File

@@ -463,6 +463,14 @@ func restoreBeadsDirFromBranch(ctx context.Context) error {
return fmt.Errorf("no .beads directory found")
}
// Skip restore when beads directory is redirected (bd-lmqhe)
// When redirected, the beads directory is in a different repo, so
// git checkout from the current repo won't work for paths outside it.
redirectInfo := beads.GetRedirectInfo()
if redirectInfo.IsRedirected {
return nil
}
// Restore .beads/ from HEAD (current branch's committed state)
// Using -- to ensure .beads/ is treated as a path, not a branch name
cmd := exec.CommandContext(ctx, "git", "checkout", "HEAD", "--", beadsDir) //nolint:gosec // G204: beadsDir from FindBeadsDir(), not user input