diff options
author | Ben Straub <bs@github.com> | 2012-10-16 13:10:27 -0700 |
---|---|---|
committer | Ben Straub <bs@github.com> | 2012-10-19 19:34:14 -0700 |
commit | 3028be0723f42f31b1973da9f19f2b0468b11754 (patch) | |
tree | 077894f4f24a735cda1361680f14affa35efc37d | |
parent | 92f91b0e3bc3b7799b2b18ea07b167ad191a47a9 (diff) | |
download | libgit2-3028be0723f42f31b1973da9f19f2b0468b11754.tar.gz |
Add git_indexer_stats field to git_remote
Also removing all the *stats parameters from external
APIs that don't need them anymore.
-rw-r--r-- | include/git2/remote.h | 2 | ||||
-rw-r--r-- | src/clone.c | 2 | ||||
-rw-r--r-- | src/fetch.c | 6 | ||||
-rw-r--r-- | src/fetch.h | 2 | ||||
-rw-r--r-- | src/remote.c | 6 | ||||
-rw-r--r-- | src/remote.h | 1 | ||||
-rw-r--r-- | tests-clar/network/fetch.c | 3 |
7 files changed, 11 insertions, 11 deletions
diff --git a/include/git2/remote.h b/include/git2/remote.h index 6471acc6a..ecd597518 100644 --- a/include/git2/remote.h +++ b/include/git2/remote.h @@ -186,7 +186,7 @@ GIT_EXTERN(int) git_remote_ls(git_remote *remote, git_headlist_cb list_cb, void * @param filename where to store the temporary filename * @return 0 or an error code */ -GIT_EXTERN(int) git_remote_download(git_remote *remote, git_off_t *bytes, git_indexer_stats *stats); +GIT_EXTERN(int) git_remote_download(git_remote *remote, git_off_t *bytes); /** * Check whether the remote is connected diff --git a/src/clone.c b/src/clone.c index 85e69ad97..215185610 100644 --- a/src/clone.c +++ b/src/clone.c @@ -263,7 +263,7 @@ static int setup_remotes_and_fetch(git_repository *repo, 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, fetch_stats)) { + if (!git_remote_download(origin, &bytes)) { /* 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 dc01f6791..242946356 100644 --- a/src/fetch.c +++ b/src/fetch.c @@ -302,7 +302,7 @@ on_error: return error; } -int git_fetch_download_pack(git_remote *remote, git_off_t *bytes, git_indexer_stats *stats) +int git_fetch_download_pack(git_remote *remote, git_off_t *bytes) { git_transport *t = remote->transport; @@ -310,9 +310,9 @@ int git_fetch_download_pack(git_remote *remote, git_off_t *bytes, git_indexer_st return 0; if (t->own_logic) - return t->download_pack(t, remote->repo, bytes, stats); + return t->download_pack(t, remote->repo, bytes, &remote->stats); - return git_fetch__download_pack(t, remote->repo, bytes, stats); + return git_fetch__download_pack(t, remote->repo, bytes, &remote->stats); } diff --git a/src/fetch.h b/src/fetch.h index 87bb43b07..ae030c6eb 100644 --- a/src/fetch.h +++ b/src/fetch.h @@ -10,7 +10,7 @@ #include "netops.h" int git_fetch_negotiate(git_remote *remote); -int git_fetch_download_pack(git_remote *remote, git_off_t *bytes, git_indexer_stats *stats); +int git_fetch_download_pack(git_remote *remote, git_off_t *bytes); int git_fetch__download_pack(git_transport *t, git_repository *repo, git_off_t *bytes, git_indexer_stats *stats); int git_fetch_setup_walk(git_revwalk **out, git_repository *repo); diff --git a/src/remote.c b/src/remote.c index c47f2d1ec..82ab22f4a 100644 --- a/src/remote.c +++ b/src/remote.c @@ -433,16 +433,16 @@ int git_remote_ls(git_remote *remote, git_headlist_cb list_cb, void *payload) return 0; } -int git_remote_download(git_remote *remote, git_off_t *bytes, git_indexer_stats *stats) +int git_remote_download(git_remote *remote, git_off_t *bytes) { int error; - assert(remote && bytes && stats); + assert(remote && bytes); if ((error = git_fetch_negotiate(remote)) < 0) return error; - return git_fetch_download_pack(remote, bytes, stats); + return git_fetch_download_pack(remote, bytes); } int git_remote_update_tips(git_remote *remote) diff --git a/src/remote.h b/src/remote.h index 05073db8c..1ba82608b 100644 --- a/src/remote.h +++ b/src/remote.h @@ -25,6 +25,7 @@ struct git_remote { git_transport *transport; git_repository *repo; git_remote_callbacks callbacks; + git_indexer_stats stats; unsigned int need_pack:1, download_tags:2, /* There are four possible values */ check_cert:1; diff --git a/tests-clar/network/fetch.c b/tests-clar/network/fetch.c index 5ff7b0af8..1e9a2323e 100644 --- a/tests-clar/network/fetch.c +++ b/tests-clar/network/fetch.c @@ -32,7 +32,6 @@ static void do_fetch(const char *url, int flag, int n) { git_remote *remote; git_off_t bytes; - git_indexer_stats stats; git_remote_callbacks callbacks; memset(&callbacks, 0, sizeof(git_remote_callbacks)); @@ -43,7 +42,7 @@ static void do_fetch(const char *url, int flag, int n) git_remote_set_callbacks(remote, &callbacks); git_remote_set_autotag(remote, flag); cl_git_pass(git_remote_connect(remote, GIT_DIR_FETCH)); - cl_git_pass(git_remote_download(remote, &bytes, &stats)); + cl_git_pass(git_remote_download(remote, &bytes)); git_remote_disconnect(remote); cl_git_pass(git_remote_update_tips(remote)); cl_assert_equal_i(counter, n); |