mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-03 13:01:14 +00:00
Add git_indexer_stats field to git_remote
Also removing all the *stats parameters from external APIs that don't need them anymore.
This commit is contained in:
parent
92f91b0e3b
commit
3028be0723
@ -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
|
* @param filename where to store the temporary filename
|
||||||
* @return 0 or an error code
|
* @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
|
* Check whether the remote is connected
|
||||||
|
@ -263,7 +263,7 @@ static int setup_remotes_and_fetch(git_repository *repo,
|
|||||||
if (!git_remote_add(&origin, repo, GIT_REMOTE_ORIGIN, origin_url)) {
|
if (!git_remote_add(&origin, repo, GIT_REMOTE_ORIGIN, origin_url)) {
|
||||||
/* Connect and download everything */
|
/* Connect and download everything */
|
||||||
if (!git_remote_connect(origin, GIT_DIR_FETCH)) {
|
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 */
|
/* Create "origin/foo" branches for all remote branches */
|
||||||
if (!git_remote_update_tips(origin)) {
|
if (!git_remote_update_tips(origin)) {
|
||||||
/* Point HEAD to the same ref as the remote's head */
|
/* Point HEAD to the same ref as the remote's head */
|
||||||
|
@ -302,7 +302,7 @@ on_error:
|
|||||||
return 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;
|
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;
|
return 0;
|
||||||
|
|
||||||
if (t->own_logic)
|
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);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
#include "netops.h"
|
#include "netops.h"
|
||||||
|
|
||||||
int git_fetch_negotiate(git_remote *remote);
|
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__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);
|
int git_fetch_setup_walk(git_revwalk **out, git_repository *repo);
|
||||||
|
@ -433,16 +433,16 @@ int git_remote_ls(git_remote *remote, git_headlist_cb list_cb, void *payload)
|
|||||||
return 0;
|
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;
|
int error;
|
||||||
|
|
||||||
assert(remote && bytes && stats);
|
assert(remote && bytes);
|
||||||
|
|
||||||
if ((error = git_fetch_negotiate(remote)) < 0)
|
if ((error = git_fetch_negotiate(remote)) < 0)
|
||||||
return error;
|
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)
|
int git_remote_update_tips(git_remote *remote)
|
||||||
|
@ -25,6 +25,7 @@ struct git_remote {
|
|||||||
git_transport *transport;
|
git_transport *transport;
|
||||||
git_repository *repo;
|
git_repository *repo;
|
||||||
git_remote_callbacks callbacks;
|
git_remote_callbacks callbacks;
|
||||||
|
git_indexer_stats stats;
|
||||||
unsigned int need_pack:1,
|
unsigned int need_pack:1,
|
||||||
download_tags:2, /* There are four possible values */
|
download_tags:2, /* There are four possible values */
|
||||||
check_cert:1;
|
check_cert:1;
|
||||||
|
@ -32,7 +32,6 @@ static void do_fetch(const char *url, int flag, int n)
|
|||||||
{
|
{
|
||||||
git_remote *remote;
|
git_remote *remote;
|
||||||
git_off_t bytes;
|
git_off_t bytes;
|
||||||
git_indexer_stats stats;
|
|
||||||
git_remote_callbacks callbacks;
|
git_remote_callbacks callbacks;
|
||||||
|
|
||||||
memset(&callbacks, 0, sizeof(git_remote_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_callbacks(remote, &callbacks);
|
||||||
git_remote_set_autotag(remote, flag);
|
git_remote_set_autotag(remote, flag);
|
||||||
cl_git_pass(git_remote_connect(remote, GIT_DIR_FETCH));
|
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);
|
git_remote_disconnect(remote);
|
||||||
cl_git_pass(git_remote_update_tips(remote));
|
cl_git_pass(git_remote_update_tips(remote));
|
||||||
cl_assert_equal_i(counter, n);
|
cl_assert_equal_i(counter, n);
|
||||||
|
Loading…
Reference in New Issue
Block a user