config: one resolver for which remote this board rides

github.remote() decided it for PRs; sync assumed 'origin'. The answer
moves to config, which already owns BOARD_GIT_REMOTE, resolved on demand
so config still shells out nothing at import. github.remote() becomes a
thin call to it, and git_remotes() lets a caller check whether the name
resolves to a remote that exists rather than falling back silently.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
istos
2026-08-01 07:33:32 +02:00
co-authored by Claude Opus 5
parent 57b3073496
commit 8194a043da
2 changed files with 30 additions and 5 deletions
+3 -5
View File
@@ -39,11 +39,9 @@ def _run(cmd: list[str], cwd: Path | None = None, timeout: int = 60) -> subproce
def remote() -> str | None:
if config.GIT_REMOTE:
return config.GIT_REMOTE
result = _run(["git", "remote"])
names = result.stdout.split()
return names[0] if names else None
"""Where this board's work goes. Resolved in config, which sync asks
too — the two halves of team mode must never name different remotes."""
return config.git_remote()
def gh_available() -> bool: