Read the records at their configured paths in the review header, replay, chunk-pr, score-outcomes, reading-cost and metric-bench
This commit is contained in:
@@ -28,7 +28,7 @@ import pathlib
|
||||
import sys
|
||||
|
||||
from failure import Failure
|
||||
from git_cli.git_repo import git
|
||||
from git_cli.git_repo import git, Git
|
||||
from project_config.settings import load, ProjectConfig, SETTINGS
|
||||
|
||||
|
||||
@@ -47,9 +47,9 @@ def main(argv: list[str]) -> int:
|
||||
return 0
|
||||
|
||||
|
||||
def located(directory: str | None, home: pathlib.Path) -> ProjectConfig | Failure:
|
||||
def located(directory: str | None, home: pathlib.Path, run: Git = git) -> ProjectConfig | Failure:
|
||||
"""The config under home of the checkout that holds directory, else the current directory."""
|
||||
found = git("rev-parse", "--path-format=absolute", "--show-toplevel", "--git-common-dir", cwd=directory)
|
||||
found = run("rev-parse", "--path-format=absolute", "--show-toplevel", "--git-common-dir", cwd=directory)
|
||||
if isinstance(found, Failure):
|
||||
return found
|
||||
if len(lines := found.splitlines()) != 2:
|
||||
|
||||
Reference in New Issue
Block a user