40 git_remote* remote =
nullptr;
42 if( git_remote_lookup( &remote,
m_repo,
"origin" ) != 0 )
45 return PushResult::Error;
48 git_remote_callbacks remoteCallbacks;
49 git_remote_init_callbacks( &remoteCallbacks, GIT_REMOTE_CALLBACKS_VERSION );
54 remoteCallbacks.payload =
this;
56 if( git_remote_connect( remote, GIT_DIRECTION_PUSH, &remoteCallbacks,
nullptr,
nullptr ) )
58 git_remote_free( remote );
60 return PushResult::Error;
63 git_push_options pushOptions;
64 git_push_init_options( &pushOptions, GIT_PUSH_OPTIONS_VERSION );
65 pushOptions.callbacks = remoteCallbacks;
67 if( git_remote_push( remote,
nullptr, &pushOptions ) )
69 git_remote_free( remote );
71 return PushResult::Error;
void ReportProgress(int aCurrent, int aTotal, const wxString &aMessage)
GIT_PUSH_HANDLER(git_repository *aRepo)
void UpdateProgress(int aCurrent, int aTotal, const wxString &aMessage) override
void AddErrorString(const wxString aErrorString)
int update_cb(const char *aRefname, const git_oid *aFirst, const git_oid *aSecond, void *aPayload)
int transfer_progress_cb(const git_transfer_progress *aStats, void *aPayload)
int push_transfer_progress_cb(unsigned int aCurrent, unsigned int aTotal, size_t aBytes, void *aPayload)
int progress_cb(const char *str, int len, void *data)