feat(context): centralize RepoContext API for git operations (#1102)
Centralizes repository context resolution via RepoContext API, fixing bugs where git commands run in the wrong repo when BEADS_DIR points elsewhere or in worktree scenarios.
This commit is contained in:
committed by
GitHub
parent
159114563b
commit
0a48519561
@@ -972,6 +972,10 @@ func getRemoteForBranch(ctx context.Context, worktreePath, branch string) string
|
||||
// GetRepoRoot returns the git repository root directory
|
||||
// For worktrees, this returns the main repository root (not the worktree root)
|
||||
// The returned path is canonicalized to fix case on case-insensitive filesystems (GH#880)
|
||||
//
|
||||
// Deprecated: Use beads.GetRepoContext().RepoRoot instead. GetRepoContext provides
|
||||
// a unified API that correctly handles BEADS_DIR, worktrees, and redirects.
|
||||
// This function will be removed in a future release.
|
||||
func GetRepoRoot(ctx context.Context) (string, error) {
|
||||
var repoRoot string
|
||||
|
||||
|
||||
Reference in New Issue
Block a user