summaryrefslogtreecommitdiff
path: root/tests/online/clone.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/online/clone.c')
-rw-r--r--tests/online/clone.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/tests/online/clone.c b/tests/online/clone.c
index 5eda73f87..b9230eca6 100644
--- a/tests/online/clone.c
+++ b/tests/online/clone.c
@@ -263,8 +263,8 @@ static int cred_failure_cb(
void test_online_clone__cred_callback_failure_return_code_is_tunnelled(void)
{
- if (!_remote_url || !_remote_user)
- clar__skip();
+ _remote_url = git__strdup("https://github.com/libgit2/non-existent");
+ _remote_user = git__strdup("libgit2test");
g_options.fetch_opts.callbacks.credentials = cred_failure_cb;
@@ -293,8 +293,8 @@ void test_online_clone__cred_callback_called_again_on_auth_failure(void)
{
size_t counter = 0;
- if (!_remote_url || !_remote_user)
- clar__skip();
+ _remote_url = git__strdup("https://github.com/libgit2/non-existent");
+ _remote_user = git__strdup("libgit2test");
g_options.fetch_opts.callbacks.credentials = cred_count_calls_cb;
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
void test_online_clone__proxy_credentials_request(void)
{
+ git_buf url = GIT_BUF_INIT;
+
if (!_remote_proxy_url || !_remote_proxy_user || !_remote_proxy_pass)
cl_skip();
+ cl_git_pass(git_buf_printf(&url, "http://%s/", _remote_proxy_url));
+
g_options.fetch_opts.proxy_opts.type = GIT_PROXY_SPECIFIED;
- g_options.fetch_opts.proxy_opts.url = _remote_proxy_url;
+ g_options.fetch_opts.proxy_opts.url = url.ptr;
g_options.fetch_opts.proxy_opts.credentials = proxy_creds;
called_proxy_creds = 0;
cl_git_pass(git_clone(&g_repo, "http://github.com/libgit2/TestGitRepository", "./foo", &g_options));
cl_assert(called_proxy_creds);
+
+ git_buf_free(&url);
}
void test_online_clone__proxy_credentials_in_url(void)
{
- if (!_remote_proxy_url)
+ git_buf url = GIT_BUF_INIT;
+
+ if (!_remote_proxy_url || !_remote_proxy_user || !_remote_proxy_pass)
cl_skip();
+ cl_git_pass(git_buf_printf(&url, "http://%s:%s@%s/", _remote_proxy_user, _remote_proxy_pass, _remote_proxy_url));
+
g_options.fetch_opts.proxy_opts.type = GIT_PROXY_SPECIFIED;
- g_options.fetch_opts.proxy_opts.url = _remote_proxy_url;
+ g_options.fetch_opts.proxy_opts.url = url.ptr;
called_proxy_creds = 0;
cl_git_pass(git_clone(&g_repo, "http://github.com/libgit2/TestGitRepository", "./foo", &g_options));
cl_assert(called_proxy_creds == 0);