@@ -263,8 +263,8 @@ static int cred_failure_cb(
263263
264264void test_online_clone__cred_callback_failure_return_code_is_tunnelled (void )
265265{
266- if (! _remote_url || ! _remote_user )
267- clar__skip ( );
266+ _remote_url = git__strdup ( "https://github.com/libgit2/non-existent" );
267+ _remote_user = git__strdup ( "libgit2test" );
268268
269269 g_options .fetch_opts .callbacks .credentials = cred_failure_cb ;
270270
@@ -293,8 +293,8 @@ void test_online_clone__cred_callback_called_again_on_auth_failure(void)
293293{
294294 size_t counter = 0 ;
295295
296- if (! _remote_url || ! _remote_user )
297- clar__skip ( );
296+ _remote_url = git__strdup ( "https://github.com/libgit2/non-existent" );
297+ _remote_user = git__strdup ( "libgit2test" );
298298
299299 g_options .fetch_opts .callbacks .credentials = cred_count_calls_cb ;
300300 g_options .fetch_opts .callbacks .payload = & counter ;
@@ -677,24 +677,34 @@ static int proxy_creds(git_cred **out, const char *url, const char *username, un
677677
678678void test_online_clone__proxy_credentials_request (void )
679679{
680+ git_buf url = GIT_BUF_INIT ;
681+
680682 if (!_remote_proxy_url || !_remote_proxy_user || !_remote_proxy_pass )
681683 cl_skip ();
682684
685+ cl_git_pass (git_buf_printf (& url , "http://%s/" , _remote_proxy_url ));
686+
683687 g_options .fetch_opts .proxy_opts .type = GIT_PROXY_SPECIFIED ;
684- g_options .fetch_opts .proxy_opts .url = _remote_proxy_url ;
688+ g_options .fetch_opts .proxy_opts .url = url . ptr ;
685689 g_options .fetch_opts .proxy_opts .credentials = proxy_creds ;
686690 called_proxy_creds = 0 ;
687691 cl_git_pass (git_clone (& g_repo , "http://github.com/libgit2/TestGitRepository" , "./foo" , & g_options ));
688692 cl_assert (called_proxy_creds );
693+
694+ git_buf_free (& url );
689695}
690696
691697void test_online_clone__proxy_credentials_in_url (void )
692698{
693- if (!_remote_proxy_url )
699+ git_buf url = GIT_BUF_INIT ;
700+
701+ if (!_remote_proxy_url || !_remote_proxy_user || !_remote_proxy_pass )
694702 cl_skip ();
695703
704+ cl_git_pass (git_buf_printf (& url , "http://%s:%s@%s/" , _remote_proxy_user , _remote_proxy_pass , _remote_proxy_url ));
705+
696706 g_options .fetch_opts .proxy_opts .type = GIT_PROXY_SPECIFIED ;
697- g_options .fetch_opts .proxy_opts .url = _remote_proxy_url ;
707+ g_options .fetch_opts .proxy_opts .url = url . ptr ;
698708 called_proxy_creds = 0 ;
699709 cl_git_pass (git_clone (& g_repo , "http://github.com/libgit2/TestGitRepository" , "./foo" , & g_options ));
700710 cl_assert (called_proxy_creds == 0 );
0 commit comments