|
KiCad PCB EDA Suite
|
#include <kigit_transport.h>
Classes | |
| struct | STATE |
Public Member Functions | |
| REMOTE_TRANSPORT (KIGIT_REPO_MIXIN *aHandler, git_remote *aRemote=nullptr, bool aFollowRedirects=true) | |
| aHandler supplies the session and records progress, the credentials offered and why a call failed. | |
| ~REMOTE_TRANSPORT () | |
| REMOTE_TRANSPORT (const REMOTE_TRANSPORT &)=delete | |
| REMOTE_TRANSPORT & | operator= (const REMOTE_TRANSPORT &)=delete |
| int | Fetch (std::vector< wxString > *aBranches=nullptr) |
Fetch as git fetch would. aBranches, when given, receives the branches the remote advertised. | |
| int | Push (const std::function< wxString()> &aConnected) |
| Connect, then push the refspec aConnected answers, so the caller can check what it pushes after a connection that may have taken long. | |
| int | Check () |
| Connect, which proves the credentials and the host key without transferring anything. | |
| int | Clone (const wxString &aUrl, const wxString &aPath, git_repository **aRepo) |
| Clone aUrl into aPath. The new repository is returned in aRepo for the caller to free. | |
| const KIGIT_ERROR_INFO & | Error () const |
| libgit2's error for the last call that failed, read before anything else could replace it | |
Private Member Functions | |
| int | connect (git_direction aDirection, const git_remote_callbacks &aCallbacks) |
Private Attributes | |
| std::unique_ptr< STATE > | m_state |
| git_remote * | m_remote |
| bool | m_followRedirects |
Definition at line 46 of file kigit_transport.h.
|
explicit |
aHandler supplies the session and records progress, the credentials offered and why a call failed.
aRemote is the caller's and must outlive the transport. A transport for a clone takes none. Without aFollowRedirects a push the server redirects fails, so it reaches only the address the caller checked. Older libgit2 versions cannot enforce this and use their default redirect behavior.
Definition at line 473 of file kigit_transport.cpp.
References m_followRedirects, m_remote, and m_state.
Referenced by operator=(), and REMOTE_TRANSPORT().
|
default |
|
delete |
References REMOTE_TRANSPORT().
| int KIGIT::REMOTE_TRANSPORT::Check | ( | ) |
Connect, which proves the credentials and the host key without transferring anything.
Definition at line 588 of file kigit_transport.cpp.
References connect(), m_remote, and m_state.
Referenced by DIALOG_GIT_REPOSITORY::OnTestClick(), and operator=().
| int KIGIT::REMOTE_TRANSPORT::Clone | ( | const wxString & | aUrl, |
| const wxString & | aPath, | ||
| git_repository ** | aRepo ) |
Clone aUrl into aPath. The new repository is returned in aRepo for the caller to free.
Definition at line 600 of file kigit_transport.cpp.
References git_repository, and m_state.
Referenced by LIBGIT_BACKEND::Clone(), and operator=().
|
private |
Definition at line 485 of file kigit_transport.cpp.
References m_followRedirects, m_remote, and m_state.
Referenced by Check(), Fetch(), operator=(), and Push().
| const KIGIT_ERROR_INFO & KIGIT::REMOTE_TRANSPORT::Error | ( | ) | const |
libgit2's error for the last call that failed, read before anything else could replace it
Definition at line 624 of file kigit_transport.cpp.
References m_state.
Referenced by LIBGIT_BACKEND::Clone(), fetchRemote(), DIALOG_GIT_REPOSITORY::OnTestClick(), and LIBGIT_BACKEND::Push().
| int KIGIT::REMOTE_TRANSPORT::Fetch | ( | std::vector< wxString > * | aBranches = nullptr | ) |
Fetch as git fetch would. aBranches, when given, receives the branches the remote advertised.
Definition at line 513 of file kigit_transport.cpp.
References connect(), m_remote, m_state, and name.
Referenced by fetchRemote(), and operator=().
|
delete |
References Check(), Clone(), connect(), Fetch(), git_repository, Push(), and REMOTE_TRANSPORT().
| int KIGIT::REMOTE_TRANSPORT::Push | ( | const std::function< wxString()> & | aConnected | ) |
Connect, then push the refspec aConnected answers, so the caller can check what it pushes after a connection that may have taken long.
An empty answer disconnects and returns GIT_EUSER.
Definition at line 548 of file kigit_transport.cpp.
References connect(), m_followRedirects, m_remote, and m_state.
Referenced by BOOST_AUTO_TEST_CASE(), operator=(), and LIBGIT_BACKEND::Push().
|
private |
Definition at line 87 of file kigit_transport.h.
Referenced by connect(), Push(), and REMOTE_TRANSPORT().
|
private |
Definition at line 86 of file kigit_transport.h.
Referenced by Check(), connect(), Fetch(), Push(), and REMOTE_TRANSPORT().
|
private |
Definition at line 85 of file kigit_transport.h.
Referenced by Check(), Clone(), connect(), Error(), Fetch(), Push(), and REMOTE_TRANSPORT().