summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/network/clone.c6
-rw-r--r--examples/network/fetch.c4
-rw-r--r--examples/network/ls-remote.c4
3 files changed, 8 insertions, 6 deletions
diff --git a/examples/network/clone.c b/examples/network/clone.c
index a09a94728..db35bd7db 100644
--- a/examples/network/clone.c
+++ b/examples/network/clone.c
@@ -74,9 +74,9 @@ int do_clone(git_repository *repo, int argc, char **argv)
checkout_opts.progress_cb = checkout_progress;
checkout_opts.progress_payload = &pd;
clone_opts.checkout_opts = checkout_opts;
- clone_opts.fetch_progress_cb = &fetch_progress;
- clone_opts.fetch_progress_payload = &pd;
- clone_opts.cred_acquire_cb = cred_acquire_cb;
+ clone_opts.remote_callbacks.transfer_progress = &fetch_progress;
+ clone_opts.remote_callbacks.credentials = cred_acquire_cb;
+ clone_opts.remote_callbacks.payload = &pd;
// Do the clone
error = git_clone(&cloned_repo, url, path, &clone_opts);
diff --git a/examples/network/fetch.c b/examples/network/fetch.c
index ce016ce0b..0c545ad7e 100644
--- a/examples/network/fetch.c
+++ b/examples/network/fetch.c
@@ -35,7 +35,7 @@ static void *download(void *ptr)
// Download the packfile and index it. This function updates the
// amount of received data and the indexer stats which lets you
// inform the user about progress.
- if (git_remote_download(data->remote, NULL, NULL) < 0) {
+ if (git_remote_download(data->remote) < 0) {
data->ret = -1;
goto exit;
}
@@ -91,8 +91,8 @@ int fetch(git_repository *repo, int argc, char **argv)
// Set up the callbacks (only update_tips for now)
callbacks.update_tips = &update_cb;
callbacks.progress = &progress_cb;
+ callbacks.credentials = cred_acquire_cb;
git_remote_set_callbacks(remote, &callbacks);
- git_remote_set_cred_acquire_cb(remote, &cred_acquire_cb, NULL);
// Set up the information for the background worker thread
data.remote = remote;
diff --git a/examples/network/ls-remote.c b/examples/network/ls-remote.c
index b22ac47a0..b65759ed3 100644
--- a/examples/network/ls-remote.c
+++ b/examples/network/ls-remote.c
@@ -18,6 +18,7 @@ static int use_remote(git_repository *repo, char *name)
{
git_remote *remote = NULL;
int error;
+ git_remote_callbacks callbacks = GIT_REMOTE_CALLBACKS_INIT;
// Find the remote by name
error = git_remote_load(&remote, repo, name);
@@ -27,7 +28,8 @@ static int use_remote(git_repository *repo, char *name)
goto cleanup;
}
- git_remote_set_cred_acquire_cb(remote, &cred_acquire_cb, NULL);
+ callbacks.credentials = cred_acquire_cb;
+ git_remote_set_callbacks(remote, &callbacks);
error = git_remote_connect(remote, GIT_DIRECTION_FETCH);
if (error < 0)