summaryrefslogtreecommitdiff
path: root/examples/network/fetch.c
diff options
context:
space:
mode:
authorBen Straub <bs@github.com>2012-10-24 14:07:07 -0700
committerBen Straub <bs@github.com>2012-10-24 14:07:07 -0700
commit1e3b8ed5cfe784f73a123c33c90f573742d8839e (patch)
tree52514d7be3372af3588a5d9f394710782ad687ab /examples/network/fetch.c
parent9762ad993dc1afff90a3d14751f1b1f666ad0c95 (diff)
downloadlibgit2-1e3b8ed5cfe784f73a123c33c90f573742d8839e.tar.gz
Remove 'bytes' param from git_remote_download
Diffstat (limited to 'examples/network/fetch.c')
-rw-r--r--examples/network/fetch.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/examples/network/fetch.c b/examples/network/fetch.c
index 8bfe10c5c..496498e8c 100644
--- a/examples/network/fetch.c
+++ b/examples/network/fetch.c
@@ -8,7 +8,6 @@
struct dl_data {
git_remote *remote;
- git_off_t *bytes;
int ret;
int finished;
};
@@ -34,7 +33,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, data->bytes, NULL, NULL) < 0) {
+ if (git_remote_download(data->remote, NULL, NULL) < 0) {
data->ret = -1;
goto exit;
}
@@ -68,7 +67,6 @@ static int update_cb(const char *refname, const git_oid *a, const git_oid *b, vo
int fetch(git_repository *repo, int argc, char **argv)
{
git_remote *remote = NULL;
- git_off_t bytes = 0;
const git_transfer_progress *stats;
pthread_t worker;
struct dl_data data;
@@ -90,7 +88,6 @@ int fetch(git_repository *repo, int argc, char **argv)
// Set up the information for the background worker thread
data.remote = remote;
- data.bytes = &bytes;
data.ret = 0;
data.finished = 0;
@@ -108,7 +105,7 @@ int fetch(git_repository *repo, int argc, char **argv)
if (stats->total_objects > 0)
printf("Received %d/%d objects (%d) in %d bytes\r",
stats->received_objects, stats->total_objects,
- stats->indexed_objects, bytes);
+ stats->indexed_objects, stats->received_bytes);
} while (!data.finished);
if (data.ret < 0)
@@ -116,7 +113,7 @@ int fetch(git_repository *repo, int argc, char **argv)
pthread_join(worker, NULL);
printf("\rReceived %d/%d objects in %zu bytes\n",
- stats->indexed_objects, stats->total_objects, bytes);
+ stats->indexed_objects, stats->total_objects, stats->received_bytes);
// Disconnect the underlying connection to prevent from idling.
git_remote_disconnect(remote);