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
@@ -86,20 +86,10 @@ func findJSONLPath() string {
|
||||
if err := os.MkdirAll(dbDir, 0750); err != nil {
|
||||
// If we can't create the directory, return discovered path anyway
|
||||
// (the subsequent write will fail with a clearer error)
|
||||
return canonicalizeIfRelative(jsonlPath)
|
||||
return utils.CanonicalizeIfRelative(jsonlPath)
|
||||
}
|
||||
|
||||
return canonicalizeIfRelative(jsonlPath)
|
||||
}
|
||||
|
||||
// canonicalizeIfRelative ensures path is absolute for filepath.Rel() compatibility.
|
||||
// Guards against any code path that might set dbPath to relative.
|
||||
// See GH#959 for root cause analysis.
|
||||
func canonicalizeIfRelative(path string) string {
|
||||
if path != "" && !filepath.IsAbs(path) {
|
||||
return utils.CanonicalizePath(path)
|
||||
}
|
||||
return path
|
||||
return utils.CanonicalizeIfRelative(jsonlPath)
|
||||
}
|
||||
|
||||
// detectPrefixFromJSONL extracts the issue prefix from JSONL data.
|
||||
|
||||
Reference in New Issue
Block a user