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 {