summaryrefslogtreecommitdiff
path: root/examples/network
diff options
context:
space:
mode:
authorVicent Marti <tanoku@gmail.com>2014-06-20 14:42:16 +0200
committerVicent Marti <tanoku@gmail.com>2014-06-20 14:42:16 +0200
commit28f087c8642ff9c8dd6964e101e6d8539db6281a (patch)
tree3518d1bf420e92c964bed03074575d8a1db88654 /examples/network
parent4b0a36e881506a02b43a4ae3c19c93c919b36eeb (diff)
parent1589aa0c4d48fb130d8a5db28c45cd3d173cde6d (diff)
downloadlibgit2-28f087c8642ff9c8dd6964e101e6d8539db6281a.tar.gz
libgit2 v0.21.0v0.21.0
Diffstat (limited to 'examples/network')
-rw-r--r--examples/network/clone.c4
-rw-r--r--examples/network/fetch.c6
-rw-r--r--examples/network/ls-remote.c2
3 files changed, 6 insertions, 6 deletions
diff --git a/examples/network/clone.c b/examples/network/clone.c
index 4df47eb7f..182d1c35b 100644
--- a/examples/network/clone.c
+++ b/examples/network/clone.c
@@ -22,7 +22,7 @@ static void print_progress(const progress_data *pd)
int index_percent = (100*pd->fetch_progress.indexed_objects) / pd->fetch_progress.total_objects;
int checkout_percent = pd->total_steps > 0
? (100 * pd->completed_steps) / pd->total_steps
- : 0.f;
+ : 0;
int kbytes = pd->fetch_progress.received_bytes / 1024;
if (pd->fetch_progress.received_objects == pd->fetch_progress.total_objects) {
@@ -62,7 +62,7 @@ int do_clone(git_repository *repo, int argc, char **argv)
progress_data pd = {{0}};
git_repository *cloned_repo = NULL;
git_clone_options clone_opts = GIT_CLONE_OPTIONS_INIT;
- git_checkout_opts checkout_opts = GIT_CHECKOUT_OPTS_INIT;
+ git_checkout_options checkout_opts = GIT_CHECKOUT_OPTIONS_INIT;
const char *url = argv[1];
const char *path = argv[2];
int error;
diff --git a/examples/network/fetch.c b/examples/network/fetch.c
index 474b45bbb..03f1541a4 100644
--- a/examples/network/fetch.c
+++ b/examples/network/fetch.c
@@ -91,13 +91,13 @@ int fetch(git_repository *repo, int argc, char **argv)
// Figure out whether it's a named remote or a URL
printf("Fetching %s for repo %p\n", argv[1], repo);
if (git_remote_load(&remote, repo, argv[1]) < 0) {
- if (git_remote_create_inmemory(&remote, repo, NULL, argv[1]) < 0)
+ if (git_remote_create_anonymous(&remote, repo, argv[1], NULL) < 0)
return -1;
}
// Set up the callbacks (only update_tips for now)
callbacks.update_tips = &update_cb;
- callbacks.progress = &progress_cb;
+ callbacks.sideband_progress = &progress_cb;
callbacks.credentials = cred_acquire_cb;
git_remote_set_callbacks(remote, &callbacks);
@@ -156,7 +156,7 @@ int fetch(git_repository *repo, int argc, char **argv)
// right commits. This may be needed even if there was no packfile
// to download, which can happen e.g. when the branches have been
// changed but all the neede objects are available locally.
- if (git_remote_update_tips(remote) < 0)
+ if (git_remote_update_tips(remote, NULL, NULL) < 0)
return -1;
git_remote_free(remote);
diff --git a/examples/network/ls-remote.c b/examples/network/ls-remote.c
index 1e08b293e..a5c14cea8 100644
--- a/examples/network/ls-remote.c
+++ b/examples/network/ls-remote.c
@@ -15,7 +15,7 @@ static int use_remote(git_repository *repo, char *name)
// Find the remote by name
error = git_remote_load(&remote, repo, name);
if (error < 0) {
- error = git_remote_create_inmemory(&remote, repo, NULL, name);
+ error = git_remote_create_anonymous(&remote, repo, name, NULL);
if (error < 0)
goto cleanup;
}