mirror of
https://git.proxmox.com/git/libgit2
synced 2025-06-22 19:19:41 +00:00
ssh: skip the localhost cert check earlier
Skip it before we attempt to clone, as we would exit with -1 on systems which do not have sshd running.
This commit is contained in:
parent
4fe5b771b5
commit
52e09724fd
@ -483,8 +483,7 @@ int ssh_certificate_check(git_cert *cert, int valid, void *payload)
|
|||||||
GIT_UNUSED(payload);
|
GIT_UNUSED(payload);
|
||||||
|
|
||||||
expected_str = cl_getenv("GITTEST_REMOTE_SSH_FINGERPRINT");
|
expected_str = cl_getenv("GITTEST_REMOTE_SSH_FINGERPRINT");
|
||||||
if (!expected_str)
|
cl_assert(expected_str);
|
||||||
cl_skip();
|
|
||||||
|
|
||||||
cl_git_pass(git_oid_fromstrp(&expected, expected_str));
|
cl_git_pass(git_oid_fromstrp(&expected, expected_str));
|
||||||
cl_assert_equal_i(GIT_CERT_HOSTKEY_LIBSSH2, cert->cert_type);
|
cl_assert_equal_i(GIT_CERT_HOSTKEY_LIBSSH2, cert->cert_type);
|
||||||
@ -512,6 +511,9 @@ void test_online_clone__ssh_cert(void)
|
|||||||
{
|
{
|
||||||
g_options.remote_callbacks.certificate_check = ssh_certificate_check;
|
g_options.remote_callbacks.certificate_check = ssh_certificate_check;
|
||||||
|
|
||||||
|
if (!cl_getenv("GITTEST_REMOTE_SSH_FINGERPRINT"))
|
||||||
|
cl_skip();
|
||||||
|
|
||||||
cl_git_fail_with(GIT_EUSER, git_clone(&g_repo, "ssh://localhost/foo", "./foo", &g_options));
|
cl_git_fail_with(GIT_EUSER, git_clone(&g_repo, "ssh://localhost/foo", "./foo", &g_options));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user