summaryrefslogtreecommitdiff
path: root/src/push.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/push.c')
-rw-r--r--src/push.c36
1 files changed, 6 insertions, 30 deletions
diff --git a/src/push.c b/src/push.c
index 3ac6fbf63..a4b61cd35 100644
--- a/src/push.c
+++ b/src/push.c
@@ -77,30 +77,6 @@ int git_push_set_options(git_push *push, const git_push_options *opts)
return 0;
}
-int git_push_set_callbacks(
- git_push *push,
- git_packbuilder_progress pack_progress_cb,
- void *pack_progress_cb_payload,
- git_push_transfer_progress transfer_progress_cb,
- void *transfer_progress_cb_payload,
- git_push_negotiation negotiation_cb,
- void *negotiation_cb_payload)
-{
- if (!push)
- return -1;
-
- push->pack_progress_cb = pack_progress_cb;
- push->pack_progress_cb_payload = pack_progress_cb_payload;
-
- push->transfer_progress_cb = transfer_progress_cb;
- push->transfer_progress_cb_payload = transfer_progress_cb_payload;
-
- push->negotiation_cb = negotiation_cb;
- push->negotiation_cb_payload = negotiation_cb_payload;
-
- return 0;
-}
-
static void free_refspec(push_spec *spec)
{
if (spec == NULL)
@@ -599,6 +575,7 @@ static int do_push(git_push *push)
{
int error = 0;
git_transport *transport = push->remote->transport;
+ git_remote_callbacks *cbs = &push->remote->callbacks;
if (!transport->push) {
giterr_set(GITERR_NET, "Remote transport doesn't support push");
@@ -617,17 +594,16 @@ static int do_push(git_push *push)
git_packbuilder_set_threads(push->pb, push->pb_parallelism);
- if (push->pack_progress_cb)
- if ((error = git_packbuilder_set_callbacks(push->pb, push->pack_progress_cb, push->pack_progress_cb_payload)) < 0)
+ if (cbs->pack_progress)
+ if ((error = git_packbuilder_set_callbacks(push->pb, cbs->pack_progress, cbs->payload)) < 0)
goto on_error;
if ((error = calculate_work(push)) < 0)
goto on_error;
- if (push->negotiation_cb &&
- (error = push->negotiation_cb((const git_push_update **) push->updates.contents,
- push->updates.length,
- push->negotiation_cb_payload)))
+ if (cbs->push_negotiation &&
+ (error = cbs->push_negotiation((const git_push_update **) push->updates.contents,
+ push->updates.length, cbs->payload)) < 0)
goto on_error;
if ((error = queue_objects(push)) < 0 ||