From 9b6965c1759fc120914a2c773cf93bd9c1c8171e Mon Sep 17 00:00:00 2001 From: ethernet Date: Thu, 17 Sep 2026 01:21:04 -0400 Subject: [PATCH] fix(install-e2e): read the transport url through the real git, not the shim arm_source_redirect installs a git PATH shim that deliberately reports the OFFICIAL origin for `remote get-url origin` so fork detection stays quiet; the file:// redirect is only visible through the real binary it exports in HERMES_E2E_REAL_GIT. The check asserted on the shimmed view, so it could never pass. Observed: 'origin transport https://github.com/NousResearch/ hermes-agent.git is not redirected'. --- tests/install/installer-script-e2e.sh | 7 ++++++- tests/install/windows-e2e.ps1 | 5 +++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/tests/install/installer-script-e2e.sh b/tests/install/installer-script-e2e.sh index 63d1100a68..41ff97bc48 100755 --- a/tests/install/installer-script-e2e.sh +++ b/tests/install/installer-script-e2e.sh @@ -240,7 +240,12 @@ assert_redirect_is_transport_only() { "$official_https"|"$official_ssh") ;; *) fail "origin is configured as '$configured', not an official URL — the redirect is not transport-only" ;; esac - observed="$(git -C "$INSTALL_DIR" remote get-url origin)" + # `git` on PATH is the shim here (it reports the official origin so fork + # detection sees it), so read the TRANSPORT url through the real git that + # arm_source_redirect exported — otherwise `remote get-url origin` returns + # the official URL and this check would always fail. + local real="${HERMES_E2E_REAL_GIT:-git}" + observed="$("$real" -C "$INSTALL_DIR" remote get-url origin)" case "$observed" in file://*|*serve.git*) ;; *) fail "origin transport '$observed' is not redirected to the staged repo" ;; diff --git a/tests/install/windows-e2e.ps1 b/tests/install/windows-e2e.ps1 index 733bcf0e3b..82f3ac2ecb 100644 --- a/tests/install/windows-e2e.ps1 +++ b/tests/install/windows-e2e.ps1 @@ -1057,8 +1057,9 @@ function Assert-RedirectIsTransportOnly { 'git@github.com:NousResearch/hermes-agent.git') $configured = (Invoke-Git @('-C', $InstallDir, 'config', '--get', 'remote.origin.url') | Out-String).Trim() Assert-True ($official -contains $configured) "origin stays configured as an official URL (got '$configured')" - $observed = (Invoke-Git @('-C', $InstallDir, 'remote', 'get-url', 'origin') | Out-String).Trim() - Assert-True ($observed -match 'serve\.git|^file://') "origin transport is redirected to the staged repo (got '$observed')" + $real = if ($env:HERMES_E2E_REAL_GIT) { $env:HERMES_E2E_REAL_GIT } else { 'git' } + $observed = (& $real -C $InstallDir remote get-url origin 2>$null | Out-String).Trim() + Assert-True ($observed -match 'serve\.git|^file://') "git transport is redirected to the staged repo (got '$observed')" } function Assert-UserShims {