42 git_remote* remote =
nullptr;
44 if( git_remote_lookup( &remote,
m_repo,
"origin" ) != 0 )
47 return PushResult::Error;
50 git_remote_callbacks remoteCallbacks;
51 git_remote_init_callbacks( &remoteCallbacks, GIT_REMOTE_CALLBACKS_VERSION );
56 remoteCallbacks.payload =
this;
58 if( git_remote_connect( remote, GIT_DIRECTION_PUSH, &remoteCallbacks,
nullptr,
nullptr ) )
60 git_remote_free( remote );
61 AddErrorString( wxString::Format(
_(
"Could not connect to remote: %s" ),
62 git_error_last()->message ) );
63 return PushResult::Error;
66 git_push_options pushOptions;
67 git_push_init_options( &pushOptions, GIT_PUSH_OPTIONS_VERSION );
68 pushOptions.callbacks = remoteCallbacks;
70 if( git_remote_push( remote,
nullptr, &pushOptions ) )
72 git_remote_free( remote );
74 git_error_last()->message ) );
75 return PushResult::Error;
void ReportProgress(int aCurrent, int aTotal, const wxString &aMessage)
GIT_PUSH_HANDLER(KIGIT_COMMON *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)