diff options
author | Carlos Martín Nieto <cmn@dwim.me> | 2013-09-16 07:02:25 +0400 |
---|---|---|
committer | Carlos Martín Nieto <cmn@dwim.me> | 2013-10-02 08:41:42 +0400 |
commit | e3c131c544bc79573ebefab4931b5ca89836ace1 (patch) | |
tree | b64b640a89ad709ba63f31dcc5e6658552e14cb4 /tests-clar/online/clone.c | |
parent | d31402a3fc4aa1b7d48ba43fd3bb072e7d69a527 (diff) |
remote: move the credentials callback to the struct
Move this one as well, letting us have a single way of setting the
callbacks for the remote, and removing fields from the clone options.
Diffstat (limited to 'tests-clar/online/clone.c')
-rw-r--r-- | tests-clar/online/clone.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/tests-clar/online/clone.c b/tests-clar/online/clone.c index bda260858..b82cbcd46 100644 --- a/tests-clar/online/clone.c +++ b/tests-clar/online/clone.c @@ -155,11 +155,13 @@ void test_online_clone__credentials(void) cl_getenv("GITTEST_REMOTE_USER"), cl_getenv("GITTEST_REMOTE_PASS") }; + git_remote_callbacks callbacks = GIT_REMOTE_CALLBACKS_INIT; if (!remote_url) return; - g_options.cred_acquire_cb = git_cred_userpass; - g_options.cred_acquire_payload = &user_pass; + callbacks.credentials = git_cred_userpass; + callbacks.payload = &user_pass; + g_options.remote_callbacks = &callbacks; cl_git_pass(git_clone(&g_repo, remote_url, "./foo", &g_options)); git_repository_free(g_repo); g_repo = NULL; @@ -172,8 +174,11 @@ void test_online_clone__bitbucket_style(void) "libgit2", "libgit2" }; - g_options.cred_acquire_cb = git_cred_userpass; - g_options.cred_acquire_payload = &user_pass; + git_remote_callbacks callbacks = GIT_REMOTE_CALLBACKS_INIT; + + callbacks.credentials = git_cred_userpass; + callbacks.payload = &user_pass; + g_options.remote_callbacks = &callbacks; cl_git_pass(git_clone(&g_repo, BB_REPO_URL, "./foo", &g_options)); git_repository_free(g_repo); g_repo = NULL; |