14#ifndef GIT_REPO_MIXIN_H
15#define GIT_REPO_MIXIN_H
31 wxASSERT( aCommon !=
nullptr );
150 void UpdateProgress(
int aCurrent,
int aTotal,
const wxString& aMessage )
override
219 void ReceiveSideband(
const char* aData,
size_t aLength );
221 void SetPushRefusal(
const wxString& aStatus );
226 const wxString& aRemoteName );
237 void addServerLine(
const wxString& aLine );
GIT_PROGRESS(wxWindow *aParent, int aMaxValue1, int aMaxValue2)
bool ReportProgress(int aCurrent, int aTotal, const wxString &aMessage)
Returns false when the user pressed the reporter's cancel button.
The project's git session.
std::shared_ptr< std::atomic< bool > > CANCEL_TOKEN
One token per operation.
std::chrono::milliseconds m_actionLockWait
void SetPassword(const wxString &aPassword)
Set the password.
wxString GetProjectDir() const
Get the project directory path, preserving symlinks if set.
std::vector< wxString > GetProjectDirs()
Get a list of project directories.
std::optional< KIGIT::HOST_KEY_FAILURE > GetHostKeyFailure() const
The host key this operation's transfer refused, for the UI to offer to trust or to report.
std::optional< KIGIT_FAILURE > m_failureKind
void CancelThisOperation()
std::optional< KIGIT::HOST_KEY_FAILURE > m_hostKeyFailure
git_repository * GetRepo() const
Get a pointer to the git repository.
void SetActionLockWait(std::chrono::milliseconds aWait)
A UI caller retrying confirmed input waits this long for a background read instead of failing at once...
bool m_skippingServerLine
void SetUsername(const wxString &aUsername)
Set the username.
KIGIT_AUTH_ATTEMPT m_authAttempt
void SetHostKeyRefusal(const wxString &aReason)
wxString m_hostKeyRefusal
KIGIT_COMMON::CANCEL_TOKEN m_cancelToken
virtual ~KIGIT_REPO_MIXIN()
void SetCancelToken(const KIGIT_COMMON::CANCEL_TOKEN &aToken)
Callbacks read this token rather than the session, so one operation's cancel cannot reach another.
const KIGIT_COMMON::CANCEL_TOKEN & CancelToken() const
wxString GetUsername() const
Get the username.
wxString GetNextPublicKey()
Get the next public key.
KIGIT_AUTH_ATTEMPT & AuthAttempt()
std::atomic< unsigned > & TestedTypes()
Return the connection types that have been tested for authentication.
std::optional< KIGIT_FAILURE > GetFailureKind() const
The kind of the last failure ReportTransferFailure classified, or none.
std::string m_pendingSideband
void ClearHostKeyFailure()
bool IsThisOperationCancelled() const
std::unique_lock< std::mutex > GetActionLock() const
void SetHostKeyFailure(const KIGIT::HOST_KEY_FAILURE &aFailure)
void SetWaitForActionLock(bool aWait)
Worker transfers may wait for a background read to finish.
KIGIT_COMMON * GetCommon() const
Get the common object.
KIGIT_REPO_MIXIN(KIGIT_COMMON *aCommon)
KIGIT_COMMON::GIT_CONN_TYPE GetConnType() const
Get the connection type.
bool WasAuthFailure() const
Set when the server refused every credential offered, so the caller can prompt and retry.
void SetSSHKey(const wxString &aSSHKey)
Set the SSH key.
void ResetTransferState()
Start a transfer with nothing left from an earlier one on this handler or session: no keys or methods...
wxString GetRemotename() const
Get the remote name.
void ResetNextKey()
Reset the next public key to test.
void UpdateProgress(int aCurrent, int aTotal, const wxString &aMessage) override
#define APIEXPORT
Macros which export functions from a DLL/DSO.
KIGIT_OPERATION
The transfer that failed, so a message nothing more specific explains can say what did not happen.
A server key the connection refused, for the UI to offer to trust or to report.
What the credential callback handed out during one operation, kept to explain a rejection.
What libgit2 reported for a failed call, read before anything else can replace it.