diff options
author | Carlos Martín Nieto <cmn@dwim.me> | 2015-04-19 00:55:00 +0200 |
---|---|---|
committer | Carlos Martín Nieto <cmn@dwim.me> | 2015-04-19 01:02:29 +0200 |
commit | efc2fec50e3bb725b2b244fdeacfb2dfad6ee78e (patch) | |
tree | 996e1ba559244e36596d98b7bb2fe4754ac94ee3 /src/push.h | |
parent | 4c02d393748d0db382450871ad9ef6898a2ce360 (diff) | |
download | libgit2-efc2fec50e3bb725b2b244fdeacfb2dfad6ee78e.tar.gz |
push: report the update plan to the callercmn/negotiation-notify
It can be useful for the caller to know which update commands will be
sent to the server before the packfile is pushed up. git does this via
the pre-push hook.
We don't have hooks, but as it adds introspection into what is
happening, we can add a callback which performs the same function.
Diffstat (limited to 'src/push.h')
-rw-r--r-- | src/push.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/push.h b/src/push.h index b19d40e03..fb5f01480 100644 --- a/src/push.h +++ b/src/push.h @@ -29,6 +29,7 @@ struct git_push { git_packbuilder *pb; git_remote *remote; git_vector specs; + git_vector updates; bool report_status; /* report-status */ @@ -42,6 +43,8 @@ struct git_push { 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; }; /** @@ -85,6 +88,8 @@ int git_push_set_options( * the upload portion of a push. Be aware that this is called inline with * pack building operations, so performance may be affected. * @param transfer_progress_cb_payload Payload for the network progress callback. + * @param push_negotiation_cb Function to call before sending the commands to the remote. + * @param push_negotiation_cb_payload Payload for the negotiation callback * @return 0 or an error code */ int git_push_set_callbacks( @@ -92,7 +97,9 @@ int git_push_set_callbacks( git_packbuilder_progress pack_progress_cb, void *pack_progress_cb_payload, git_push_transfer_progress transfer_progress_cb, - void *transfer_progress_cb_payload); + void *transfer_progress_cb_payload, + git_push_negotiation negotiation_cb, + void *negotiation_cb_payload); /** * Add a refspec to be pushed |