summaryrefslogtreecommitdiff
path: root/examples/network
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2013-10-02 14:04:44 +0200
committerCarlos Martín Nieto <cmn@dwim.me>2013-10-02 14:04:44 +0200
commit0e0cf78773bea0d06298ba3bf981a3be839041df (patch)
tree4b879238df61eccc2f048fe51e10fce421967e26 /examples/network
parentffc97d51264f8af435ccf52d33a62a6925b174c9 (diff)
downloadlibgit2-0e0cf78773bea0d06298ba3bf981a3be839041df.tar.gz
clone: put the callbacks struct directly in the clone options
There's no need for this to be a pointer to somewhere else.
Diffstat (limited to 'examples/network')
-rw-r--r--examples/network/clone.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/examples/network/clone.c b/examples/network/clone.c
index f553c4077..db35bd7db 100644
--- a/examples/network/clone.c
+++ b/examples/network/clone.c
@@ -57,7 +57,6 @@ 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;
@@ -75,10 +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;
- callbacks.transfer_progress = &fetch_progress;
- callbacks.credentials = cred_acquire_cb;
- callbacks.payload = &pd;
- clone_opts.remote_callbacks = &callbacks;
+ 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);