SlHelpers
Toggle main menu visibility
Loading...
Searching...
No Matches
FetchCallbacks.h
1
// SPDX-License-Identifier: GPL-2.0-only
2
3
#pragma once
4
5
#include <optional>
6
#include <string_view>
7
8
#include <git2.h>
9
10
namespace
SlGit {
11
17
class
FetchCallbacks
{
18
public
:
20
FetchCallbacks
() {}
21
28
virtual
void
checkoutProgress
([[maybe_unused]] std::string_view path,
29
[[maybe_unused]]
size_t
completedSteps,
30
[[maybe_unused]]
size_t
totalSteps) {}
31
40
virtual
int
credentials
([[maybe_unused]] git_credential **cred,
41
[[maybe_unused]] std::string_view url,
42
[[maybe_unused]] std::optional<std::string_view> usernameFromUrl,
43
[[maybe_unused]]
unsigned
int
allowedTypes) {
44
return
GIT_PASSTHROUGH;
45
}
46
53
virtual
int
packProgress
([[maybe_unused]]
int
stage, [[maybe_unused]] uint32_t current,
54
[[maybe_unused]] uint32_t total) {
55
return
GIT_PASSTHROUGH;
56
}
57
62
virtual
int
sidebandProgress
([[maybe_unused]] std::string_view str) {
63
return
GIT_PASSTHROUGH;
64
}
65
70
virtual
int
transferProgress
([[maybe_unused]]
const
git_indexer_progress &stats) {
71
return
GIT_PASSTHROUGH;
72
}
73
81
virtual
int
updateRefs
([[maybe_unused]] std::string_view refname,
82
[[maybe_unused]]
const
git_oid &a,
83
[[maybe_unused]]
const
git_oid &b,
84
[[maybe_unused]] git_refspec &ref) {
85
return
GIT_PASSTHROUGH;
86
}
87
};
88
89
}
SlGit::FetchCallbacks::FetchCallbacks
FetchCallbacks()
Construct FetchCallbacks.
Definition
FetchCallbacks.h:20
SlGit::FetchCallbacks::transferProgress
virtual int transferProgress(const git_indexer_progress &stats)
Called many times during download and indexing.
Definition
FetchCallbacks.h:70
SlGit::FetchCallbacks::updateRefs
virtual int updateRefs(std::string_view refname, const git_oid &a, const git_oid &b, git_refspec &ref)
Called for each updated reference.
Definition
FetchCallbacks.h:81
SlGit::FetchCallbacks::sidebandProgress
virtual int sidebandProgress(std::string_view str)
Callback for messages received by the transport.
Definition
FetchCallbacks.h:62
SlGit::FetchCallbacks::credentials
virtual int credentials(git_credential **cred, std::string_view url, std::optional< std::string_view > usernameFromUrl, unsigned int allowedTypes)
Fill in credentials.
Definition
FetchCallbacks.h:40
SlGit::FetchCallbacks::checkoutProgress
virtual void checkoutProgress(std::string_view path, size_t completedSteps, size_t totalSteps)
Called for each path in the tree.
Definition
FetchCallbacks.h:28
SlGit::FetchCallbacks::packProgress
virtual int packProgress(int stage, uint32_t current, uint32_t total)
Called many times when packing objects.
Definition
FetchCallbacks.h:53
include
git
FetchCallbacks.h
Generated by
1.17.0