SlHelpers
SlGit::FetchCallbacks Class Reference

Callbacks invoked from Repo::clone() or Remote::fetchRefspecs() More...

#include <FetchCallbacks.h>

Inheritance diagram for SlGit::FetchCallbacks:
SlGit::DefaultFetchCallbacks

Public Member Functions

 FetchCallbacks ()
 Construct FetchCallbacks.
 
virtual void checkoutProgress ([[maybe_unused]] std::string_view path, [[maybe_unused]] size_t completedSteps, [[maybe_unused]] size_t totalSteps)
 Called for each path in the tree. More...
 
virtual int credentials ([[maybe_unused]] git_credential **cred, [[maybe_unused]] std::string_view url, [[maybe_unused]] std::optional< std::string_view > usernameFromUrl, [[maybe_unused]] unsigned int allowedTypes)
 Fill in credentials. More...
 
virtual int packProgress ([[maybe_unused]] int stage, [[maybe_unused]] uint32_t current, [[maybe_unused]] uint32_t total)
 Called many times when packing objects. More...
 
virtual int sidebandProgress ([[maybe_unused]] std::string_view str)
 Callback for messages received by the transport. More...
 
virtual int transferProgress ([[maybe_unused]] const git_indexer_progress &stats)
 Called many times during download and indexing. More...
 
virtual int updateRefs ([[maybe_unused]] std::string_view refname, [[maybe_unused]] const git_oid &a, [[maybe_unused]] const git_oid &b, [[maybe_unused]] git_refspec &ref)
 Called for each updated reference. More...
 

Detailed Description

Callbacks invoked from Repo::clone() or Remote::fetchRefspecs()

See also DefaultFetchCallbacks for the default implementation.

Member Function Documentation

◆ checkoutProgress()

virtual void SlGit::FetchCallbacks::checkoutProgress ( [[maybe_unused] ] std::string_view  path,
[[maybe_unused] ] size_t  completedSteps,
[[maybe_unused] ] size_t  totalSteps 
)
inlinevirtual

Called for each path in the tree.

Parameters
pathPath being checked out
completedStepsCount of steps done
totalStepsCount of all steps

◆ credentials()

virtual int SlGit::FetchCallbacks::credentials ( [[maybe_unused] ] git_credential **  cred,
[[maybe_unused] ] std::string_view  url,
[[maybe_unused] ] std::optional< std::string_view >  usernameFromUrl,
[[maybe_unused] ] unsigned int  allowedTypes 
)
inlinevirtual

Fill in credentials.

Parameters
credOutput
urlFor which URL
usernameFromUrlUsername detected in url
allowedTypesGIT_CREDENTIAL_USERNAME, GIT_CREDENTIAL_SSH_KEY, ...
Returns
Zero for success.

◆ packProgress()

virtual int SlGit::FetchCallbacks::packProgress ( [[maybe_unused] ] int  stage,
[[maybe_unused] ] uint32_t  current,
[[maybe_unused] ] uint32_t  total 
)
inlinevirtual

Called many times when packing objects.

Parameters
stageAt what stage the packing is (GIT_PACKBUILDER_ADDING_OBJECTS, ...)
currentCurrently packed object
totalTotal number of objects
Returns
Zero for success.

◆ sidebandProgress()

virtual int SlGit::FetchCallbacks::sidebandProgress ( [[maybe_unused] ] std::string_view  str)
inlinevirtual

Callback for messages received by the transport.

Parameters
strThe message from the transport
Returns
Zero for success.

◆ transferProgress()

virtual int SlGit::FetchCallbacks::transferProgress ( [[maybe_unused] ] const git_indexer_progress &  stats)
inlinevirtual

Called many times during download and indexing.

Parameters
statsThe statistics
Returns
Zero for success.

◆ updateRefs()

virtual int SlGit::FetchCallbacks::updateRefs ( [[maybe_unused] ] std::string_view  refname,
[[maybe_unused] ] const git_oid &  a,
[[maybe_unused] ] const git_oid &  b,
[[maybe_unused] ] git_refspec &  ref 
)
inlinevirtual

Called for each updated reference.

Parameters
refnameThe name of the reference
aThe original OID
bThe new OID
refThe reference structure
Returns
Zero for success.

The documentation for this class was generated from the following file: