Skip to content

Commit 1eb1f40

Browse files
fix: keep remote status probes noninteractive
1 parent 68d2448 commit 1eb1f40

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

‎src/ulysses_runtime_management.py‎

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,18 @@
6969
_GIT_REMOTE_CACHE_LOCK = threading.Lock()
7070

7171

72-
def _run(argv: list[str], *, cwd: Path | None = None, timeout: int = 20) -> subprocess.CompletedProcess[str]:
72+
def _run(
73+
argv: list[str],
74+
*,
75+
cwd: Path | None = None,
76+
timeout: int = 20,
77+
env: dict[str, str] | None = None,
78+
) -> subprocess.CompletedProcess[str]:
7379
try:
7480
return subprocess.run(
7581
argv,
7682
cwd=cwd,
83+
env=env,
7784
capture_output=True,
7885
text=True,
7986
timeout=timeout,
@@ -720,6 +727,11 @@ def _git_remote_status(
720727
if cached and now - cached[0] < GIT_CHECK_TTL_SECONDS:
721728
return {**result, **cached[1]}
722729

730+
probe_environment = {
731+
**os.environ,
732+
"GIT_TERMINAL_PROMPT": "0",
733+
"GCM_INTERACTIVE": "Never",
734+
}
723735
remote = _run(
724736
[
725737
"git",
@@ -729,6 +741,7 @@ def _git_remote_status(
729741
f"refs/heads/{source_branch}",
730742
],
731743
timeout=8,
744+
env=probe_environment,
732745
)
733746
fields = remote.stdout.strip().split()
734747
if remote.returncode or len(fields) < 2 or not re.fullmatch(r"[0-9a-fA-F]{40,64}", fields[0]):
@@ -767,6 +780,7 @@ def _git_remote_status(
767780
source_branch,
768781
],
769782
timeout=120,
783+
env=probe_environment,
770784
)
771785
if fetched.returncode:
772786
observed = {

0 commit comments

Comments
 (0)