diff options
| author | Carlos Martín Nieto <cmn@dwim.me> | 2013-09-16 04:20:05 +0200 |
|---|---|---|
| committer | Carlos Martín Nieto <cmn@dwim.me> | 2013-10-02 06:41:42 +0200 |
| commit | d31402a3fc4aa1b7d48ba43fd3bb072e7d69a527 (patch) | |
| tree | cc8eb1e1801c98c25349951d6cd3667d94d9ea19 /examples | |
| parent | 71e33d2649f990086237a6cd0fdb7f7d6f742b51 (diff) | |
| download | libgit2-d31402a3fc4aa1b7d48ba43fd3bb072e7d69a527.tar.gz | |
remote: put the _download() callback with the others
The text progress and update_tips callbacks are already part of the
struct, which was meant to unify the callback setup, but the download
one was left out.
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/network/clone.c | 6 | ||||
| -rw-r--r-- | examples/network/fetch.c | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/examples/network/clone.c b/examples/network/clone.c index a09a94728..f1002656c 100644 --- a/examples/network/clone.c +++ b/examples/network/clone.c @@ -57,6 +57,7 @@ int do_clone(git_repository *repo, int argc, char **argv) git_repository *cloned_repo = NULL; git_clone_options clone_opts = GIT_CLONE_OPTIONS_INIT; git_checkout_opts checkout_opts = GIT_CHECKOUT_OPTS_INIT; + git_remote_callbacks callbacks = GIT_REMOTE_CALLBACKS_INIT; const char *url = argv[1]; const char *path = argv[2]; int error; @@ -74,8 +75,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; + callbacks.transfer_progress = &fetch_progress; + callbacks.payload = &pd; + clone_opts.remote_callbacks = &callbacks; clone_opts.cred_acquire_cb = cred_acquire_cb; // Do the clone diff --git a/examples/network/fetch.c b/examples/network/fetch.c index ce016ce0b..1de223373 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; } |
