Skip to content

Commit 9bc68a7

Browse files
test: set GIT_SSH_COMMAND in V2 remote-fetch test to override env SSH (#38)
The test fakes GIT_SSH to intercept git fetch over SSH, but the host environment exports GIT_SSH_COMMAND (which takes priority over GIT_SSH), so git was using the real ssh binary and getting a real GitHub 404. Set GIT_SSH_COMMAND to the same fake script so the test is deterministic across environments. Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
1 parent 6feded7 commit 9bc68a7

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

cli/explain_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1962,6 +1962,7 @@ esac
19621962
exec git-upload-pack "$repo"
19631963
`), 0o755))
19641964
t.Setenv("GIT_SSH", sshScript)
1965+
t.Setenv("GIT_SSH_COMMAND", sshScript) // GIT_SSH_COMMAND takes priority over GIT_SSH on systems where it's set globally.
19651966
t.Setenv("CHECKPOINT_REPO", checkpointDir)
19661967

19671968
require.NoError(t, os.MkdirAll(filepath.Join(localDir, ".trace"), 0o755))

0 commit comments

Comments
 (0)