From 216863c48fd05b08e9b0083d61dcb163a2add62a Mon Sep 17 00:00:00 2001 From: Ben Straub Date: Wed, 17 Oct 2012 14:02:24 -0700 Subject: Fetch/indexer: progress callbacks --- src/fetch.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'src/fetch.c') diff --git a/src/fetch.c b/src/fetch.c index 242946356..583c79a34 100644 --- a/src/fetch.c +++ b/src/fetch.c @@ -302,7 +302,11 @@ on_error: return error; } -int git_fetch_download_pack(git_remote *remote, git_off_t *bytes) +int git_fetch_download_pack( + git_remote *remote, + git_off_t *bytes, + git_indexer_progress_callback progress_cb, + void *progress_payload) { git_transport *t = remote->transport; @@ -312,7 +316,8 @@ int git_fetch_download_pack(git_remote *remote, git_off_t *bytes) if (t->own_logic) return t->download_pack(t, remote->repo, bytes, &remote->stats); - return git_fetch__download_pack(t, remote->repo, bytes, &remote->stats); + return git_fetch__download_pack(t, remote->repo, bytes, &remote->stats, + progress_cb, progress_payload); } @@ -348,7 +353,9 @@ int git_fetch__download_pack( git_transport *t, git_repository *repo, git_off_t *bytes, - git_indexer_stats *stats) + git_indexer_stats *stats, + git_indexer_progress_callback progress_cb, + void *progress_payload) { git_buf path = GIT_BUF_INIT; gitno_buffer *buf = &t->buffer; @@ -358,7 +365,7 @@ int git_fetch__download_pack( if (git_buf_joinpath(&path, git_repository_path(repo), "objects/pack") < 0) return -1; - if (git_indexer_stream_new(&idx, git_buf_cstr(&path)) < 0) + if (git_indexer_stream_new(&idx, git_buf_cstr(&path), progress_cb, progress_payload) < 0) goto on_error; git_buf_free(&path); -- cgit v1.2.3