10#include "../helpers/Unique.h"
12#include "DefaultFetchCallbacks.h"
22 using GitTy = git_remote;
31 int depth = 0,
bool tags =
true)
const noexcept;
33 bool fetchRefspecs(
const std::vector<std::string> &refspecs = {},
int depth = 0,
34 bool tags =
true)
const noexcept {
39 bool fetchBranches(
const std::vector<std::string> &branches,
int depth = 0,
40 bool tags =
true) const noexcept;
42 bool fetch(const std::
string &branch,
int depth = 0,
43 bool tags = true) const noexcept {
return fetchBranches({ branch }, depth, tags); }
46 std::string
url() const noexcept {
return git_remote_url(
remote()); }
49 const git_indexer_progress *
stats() const noexcept {
return git_remote_stats(
remote()); }
52 GitTy *
remote() const noexcept {
return m_remote.get(); }
54 operator GitTy *()
const noexcept {
return remote(); }
58 static int fetchCredentials(git_credential **out,
const char *
url,
59 const char *usernameFromUrl,
unsigned int allowedTypes,
60 void *payload)
noexcept;
61 static int fetchPackProgress(
int stage, uint32_t current, uint32_t total,
void *payload);
62 static int fetchSidebandProgress(
const char *str,
int len,
void *payload)
noexcept;
63 static int fetchTransferProgress(
const git_indexer_progress *
stats,
void *payload)
noexcept;
64#ifdef LIBGIT_HAS_UPDATE_REFS
65 static int fetchUpdateRefs(
const char *refname,
const git_oid *a,
const git_oid *b,
66 git_refspec *refspec,
void *payload)
noexcept;
The default FetchCallbacks implementation.
Definition DefaultFetchCallbacks.h:15
Callbacks invoked from Repo::clone() or Remote::fetchRefspecs().
Definition FetchCallbacks.h:17
Remote is a representation of a git remote.
Definition Remote.h:21
std::string url() const noexcept
Get the URL of this Remote.
Definition Remote.h:46
bool fetch(const std::string &branch, int depth=0, bool tags=true) const noexcept
Fetch a branch from this Remote.
Definition Remote.h:42
GitTy * remote() const noexcept
Get the stored pointer to libgit2's git_remote.
Definition Remote.h:52
bool fetchRefspecs(const std::vector< std::string > &refspecs={}, int depth=0, bool tags=true) const noexcept
Fetch refspecs from this Remote.
Definition Remote.h:33
bool fetchBranches(const std::vector< std::string > &branches, int depth=0, bool tags=true) const noexcept
Fetch branches from this Remote.
bool fetchRefspecs(FetchCallbacks &fc, const std::vector< std::string > &refspecs={}, int depth=0, bool tags=true) const noexcept
Fetch refspecs from this Remote, invoking the fc callback.
const git_indexer_progress * stats() const noexcept
Get the stats of the progress.
Definition Remote.h:49
The most important Git class.
Definition Repo.h:45
Wrapper around std::unique_ptr for easier re-definition of free.
Definition Unique.h:41