summaryrefslogtreecommitdiff
path: root/src
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 /src
parent9762ad993dc1afff90a3d14751f1b1f666ad0c95 (diff)
downloadlibgit2-1e3b8ed5cfe784f73a123c33c90f573742d8839e.tar.gz
Remove 'bytes' param from git_remote_download
Diffstat (limited to 'src')
-rw-r--r--src/clone.c3
-rw-r--r--src/fetch.c14
-rw-r--r--src/fetch.h2
-rw-r--r--src/remote.c5
-rw-r--r--src/transport.h2
5 files changed, 8 insertions, 18 deletions
diff --git a/src/clone.c b/src/clone.c
index fc2bfa1fa..ab8b9bcbb 100644
--- a/src/clone.c
+++ b/src/clone.c
@@ -256,13 +256,12 @@ static int setup_remotes_and_fetch(
{
int retcode = GIT_ERROR;
git_remote *origin = NULL;
- git_off_t bytes = 0;
/* Create the "origin" remote */
if (!git_remote_add(&origin, repo, GIT_REMOTE_ORIGIN, origin_url)) {
/* Connect and download everything */
if (!git_remote_connect(origin, GIT_DIR_FETCH)) {
- if (!git_remote_download(origin, &bytes, progress_cb, progress_payload)) {
+ if (!git_remote_download(origin, progress_cb, progress_payload)) {
/* Create "origin/foo" branches for all remote branches */
if (!git_remote_update_tips(origin)) {
/* Point HEAD to the same ref as the remote's head */
diff --git a/src/fetch.c b/src/fetch.c
index ee85f083d..0aabe744f 100644
--- a/src/fetch.c
+++ b/src/fetch.c
@@ -306,7 +306,6 @@ on_error:
int git_fetch_download_pack(
git_remote *remote,
- git_off_t *bytes,
git_transfer_progress_callback progress_cb,
void *progress_payload)
{
@@ -316,14 +315,14 @@ int git_fetch_download_pack(
return 0;
if (t->own_logic)
- return t->download_pack(t, remote->repo, bytes, &remote->stats);
+ return t->download_pack(t, remote->repo, &remote->stats);
- return git_fetch__download_pack(t, remote->repo, bytes, &remote->stats,
+ return git_fetch__download_pack(t, remote->repo, &remote->stats,
progress_cb, progress_payload);
}
-static int no_sideband(git_transport *t, git_indexer_stream *idx, gitno_buffer *buf, git_off_t *bytes, git_transfer_progress *stats)
+static int no_sideband(git_transport *t, git_indexer_stream *idx, gitno_buffer *buf, git_transfer_progress *stats)
{
int recvd;
@@ -340,8 +339,6 @@ static int no_sideband(git_transport *t, git_indexer_stream *idx, gitno_buffer *
if ((recvd = gitno_recv(buf)) < 0)
return -1;
-
- *bytes += recvd;
} while(recvd > 0);
if (git_indexer_stream_finalize(idx, stats))
@@ -376,7 +373,6 @@ static void network_packetsize(int received, void *payload)
int git_fetch__download_pack(
git_transport *t,
git_repository *repo,
- git_off_t *bytes,
git_transfer_progress *stats,
git_transfer_progress_callback progress_cb,
void *progress_payload)
@@ -403,7 +399,6 @@ int git_fetch__download_pack(
git_buf_free(&path);
memset(stats, 0, sizeof(git_transfer_progress));
- *bytes = 0;
/*
* If the remote doesn't support the side-band, we can feed
@@ -411,7 +406,7 @@ int git_fetch__download_pack(
* check which one belongs there.
*/
if (!t->caps.side_band && !t->caps.side_band_64k) {
- if (no_sideband(t, idx, buf, bytes, stats) < 0)
+ if (no_sideband(t, idx, buf, stats) < 0)
goto on_error;
git_indexer_stream_free(idx);
@@ -438,7 +433,6 @@ int git_fetch__download_pack(
git__free(pkt);
} else if (pkt->type == GIT_PKT_DATA) {
git_pkt_data *p = (git_pkt_data *) pkt;
- *bytes += p->len;
if (git_indexer_stream_add(idx, p->data, p->len, stats) < 0)
goto on_error;
diff --git a/src/fetch.h b/src/fetch.h
index 23d0cf66f..5b8c20665 100644
--- a/src/fetch.h
+++ b/src/fetch.h
@@ -13,14 +13,12 @@ int git_fetch_negotiate(git_remote *remote);
int git_fetch_download_pack(
git_remote *remote,
- git_off_t *bytes,
git_transfer_progress_callback progress_cb,
void *progress_payload);
int git_fetch__download_pack(
git_transport *t,
git_repository *repo,
- git_off_t *bytes,
git_transfer_progress *stats,
git_transfer_progress_callback progress_cb,
void *progress_payload);
diff --git a/src/remote.c b/src/remote.c
index 3e9a757a5..87c1ad8aa 100644
--- a/src/remote.c
+++ b/src/remote.c
@@ -435,18 +435,17 @@ int git_remote_ls(git_remote *remote, git_headlist_cb list_cb, void *payload)
int git_remote_download(
git_remote *remote,
- git_off_t *bytes,
git_transfer_progress_callback progress_cb,
void *progress_payload)
{
int error;
- assert(remote && bytes);
+ assert(remote);
if ((error = git_fetch_negotiate(remote)) < 0)
return error;
- return git_fetch_download_pack(remote, bytes, progress_cb, progress_payload);
+ return git_fetch_download_pack(remote, progress_cb, progress_payload);
}
int git_remote_update_tips(git_remote *remote)
diff --git a/src/transport.h b/src/transport.h
index 79afae000..1a3eee57d 100644
--- a/src/transport.h
+++ b/src/transport.h
@@ -113,7 +113,7 @@ struct git_transport {
/**
* Download the packfile
*/
- int (*download_pack)(struct git_transport *transport, git_repository *repo, git_off_t *bytes, git_transfer_progress *stats);
+ int (*download_pack)(struct git_transport *transport, git_repository *repo, git_transfer_progress *stats);
/**
* Close the connection
*/