summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-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);