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`.
This commit is contained in:
Edward Thomson
2025-11-30 21:33:55 +00:00
parent dfadbd0c8f
commit 7ed8f12087
2 changed files with 8 additions and 7 deletions

View File

@@ -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);

View File

@@ -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);