From 7ed8f12087cb176832c3e00e2f1646fe5c6a8f2c Mon Sep 17 00:00:00 2001 From: Edward Thomson Date: Sun, 30 Nov 2025 21:33:55 +0000 Subject: [PATCH] ssh_exec: use GIT_SSH_COMMAND in tests We specify additional arguments to the ssh executable; as a result, we specify arguments with `GIT_SSH_COMMAND`. --- tests/libgit2/online/clone.c | 8 ++++---- tests/libgit2/online/push.c | 7 ++++--- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/tests/libgit2/online/clone.c b/tests/libgit2/online/clone.c index 5c283ec4d..4c9c057e5 100644 --- a/tests/libgit2/online/clone.c +++ b/tests/libgit2/online/clone.c @@ -105,13 +105,13 @@ void test_online_clone__initialize(void) _orig_https_proxy = cl_getenv("HTTPS_PROXY"); _orig_no_proxy = cl_getenv("NO_PROXY"); - _orig_ssh_cmd = cl_getenv("GIT_SSH"); + _orig_ssh_cmd = cl_getenv("GIT_SSH_COMMAND"); _ssh_cmd = cl_getenv("GITTEST_SSH_CMD"); if (_ssh_cmd) - cl_setenv("GIT_SSH", _ssh_cmd); + cl_setenv("GIT_SSH_COMMAND", _ssh_cmd); else - cl_setenv("GIT_SSH", NULL); + cl_setenv("GIT_SSH_COMMAND", NULL); if (_remote_expectcontinue) git_libgit2_opts(GIT_OPT_ENABLE_HTTP_EXPECT_CONTINUE, 1); @@ -174,7 +174,7 @@ void test_online_clone__cleanup(void) git__free(_orig_https_proxy); git__free(_orig_no_proxy); - cl_setenv("GIT_SSH", _orig_ssh_cmd); + cl_setenv("GIT_SSH_COMMAND", _orig_ssh_cmd); git__free(_orig_ssh_cmd); git__free(_ssh_cmd); diff --git a/tests/libgit2/online/push.c b/tests/libgit2/online/push.c index 969ecaff6..c2c4644f6 100644 --- a/tests/libgit2/online/push.c +++ b/tests/libgit2/online/push.c @@ -376,13 +376,13 @@ void test_online_push__initialize(void) _remote_push_options = cl_getenv("GITTEST_PUSH_OPTIONS"); _remote = NULL; - _orig_ssh_cmd = cl_getenv("GIT_SSH"); + _orig_ssh_cmd = cl_getenv("GIT_SSH_COMMAND"); _ssh_cmd = cl_getenv("GITTEST_SSH_CMD"); if (_ssh_cmd) - cl_setenv("GIT_SSH", _ssh_cmd); + cl_setenv("GIT_SSH_COMMAND", _ssh_cmd); else - cl_setenv("GIT_SSH", NULL); + cl_setenv("GIT_SSH_COMMAND", NULL); /* Skip the test if we're missing the remote URL */ if (!_remote_url) @@ -439,6 +439,7 @@ void test_online_push__cleanup(void) git__free(_remote_expectcontinue); git__free(_remote_push_options); + cl_setenv("GIT_SSH_COMMAND", _orig_ssh_cmd); git__free(_orig_ssh_cmd); git__free(_ssh_cmd);