summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/buildtool/file_system/git_repo.cpp12
-rw-r--r--src/other_tools/git_operations/git_config_settings.cpp22
-rw-r--r--src/other_tools/ops_maps/critical_git_op_map.cpp2
-rw-r--r--src/other_tools/ops_maps/critical_git_op_map.hpp4
4 files changed, 18 insertions, 22 deletions
diff --git a/src/buildtool/file_system/git_repo.cpp b/src/buildtool/file_system/git_repo.cpp
index 800da4b8..176535b3 100644
--- a/src/buildtool/file_system/git_repo.cpp
+++ b/src/buildtool/file_system/git_repo.cpp
@@ -358,12 +358,10 @@ void fetch_backend_free(git_odb_backend* /*_backend*/) {}
auto const kFetchIntoODBParent = CreateFetchIntoODBParent();
// callback to remote fetch without an SSL certificate check
-const auto certificate_passthrough_cb = [](git_cert* /*cert*/,
- int /*valid*/,
- const char* /*host*/,
- void* /*payload*/) -> int {
- return 0;
-};
+const auto kCertificatePassthrough = [](git_cert* /*cert*/,
+ int /*valid*/,
+ const char* /*host*/,
+ void* /*payload*/) -> int { return 0; };
} // namespace
#endif // BOOTSTRAP_BUILD_TOOL
@@ -897,7 +895,7 @@ auto GitRepo::FetchFromPath(std::shared_ptr<git_config> cfg,
// no proxy
fetch_opts.proxy_opts.type = GIT_PROXY_NONE;
// no SSL verification
- fetch_opts.callbacks.certificate_check = certificate_passthrough_cb;
+ fetch_opts.callbacks.certificate_check = kCertificatePassthrough;
// disable update of the FETCH_HEAD pointer
fetch_opts.update_fetchhead = 0;
diff --git a/src/other_tools/git_operations/git_config_settings.cpp b/src/other_tools/git_operations/git_config_settings.cpp
index b0fe27bc..816e51a7 100644
--- a/src/other_tools/git_operations/git_config_settings.cpp
+++ b/src/other_tools/git_operations/git_config_settings.cpp
@@ -30,18 +30,16 @@ void config_iter_closer(gsl::owner<git_config_iterator*> iter) {
}
// callback to enable SSL certificate check for remote fetch
-const auto certificate_check_cb = [](git_cert* /*cert*/,
- int /*valid*/,
- const char* /*host*/,
- void* /*payload*/) -> int { return 1; };
+const auto kCertificateCheck = [](git_cert* /*cert*/,
+ int /*valid*/,
+ const char* /*host*/,
+ void* /*payload*/) -> int { return 1; };
// callback to remote fetch without an SSL certificate check
-const auto certificate_passthrough_cb = [](git_cert* /*cert*/,
- int /*valid*/,
- const char* /*host*/,
- void* /*payload*/) -> int {
- return 0;
-};
+const auto kCertificatePassthrough = [](git_cert* /*cert*/,
+ int /*valid*/,
+ const char* /*host*/,
+ void* /*payload*/) -> int { return 0; };
/// \brief Custom comparison of matching degrees. Return true if left argument's
/// degree of matching is better that the right argument's. When both are
@@ -187,8 +185,8 @@ auto GitConfigSettings::GetSSLCallback(std::shared_ptr<git_config> const& cfg,
}
}
// set callback: passthrough only if check_cert is false
- return (check_cert and not *check_cert) ? certificate_passthrough_cb
- : certificate_check_cb;
+ return (check_cert and not *check_cert) ? kCertificatePassthrough
+ : kCertificateCheck;
} catch (std::exception const& ex) {
(*logger)(
fmt::format("Getting SSL callback failed with:\n{}", ex.what()),
diff --git a/src/other_tools/ops_maps/critical_git_op_map.cpp b/src/other_tools/ops_maps/critical_git_op_map.cpp
index cbab7c42..b7981db8 100644
--- a/src/other_tools/ops_maps/critical_git_op_map.cpp
+++ b/src/other_tools/ops_maps/critical_git_op_map.cpp
@@ -15,7 +15,7 @@
#include "src/other_tools/ops_maps/critical_git_op_map.hpp"
// define the mapping to actual operations being called
-GitOpKeyMap const GitOpKey::map_ = {
+GitOpKeyMap const GitOpKey::kMap = {
{GitOpType::INITIAL_COMMIT, CriticalGitOps::GitInitialCommit},
{GitOpType::ENSURE_INIT, CriticalGitOps::GitEnsureInit},
{GitOpType::KEEP_TAG, CriticalGitOps::GitKeepTag},
diff --git a/src/other_tools/ops_maps/critical_git_op_map.hpp b/src/other_tools/ops_maps/critical_git_op_map.hpp
index 73ee6a70..5832462a 100644
--- a/src/other_tools/ops_maps/critical_git_op_map.hpp
+++ b/src/other_tools/ops_maps/critical_git_op_map.hpp
@@ -40,7 +40,7 @@ struct GitOpKey {
[[nodiscard]] auto operation(GitOpParams const& params,
AsyncMapConsumerLoggerPtr const& logger) const
-> GitOpValue {
- return map_.at(op_type)(params, logger);
+ return kMap.at(op_type)(params, logger);
}
[[nodiscard]] auto operator==(GitOpKey const& other) const -> bool {
@@ -48,7 +48,7 @@ struct GitOpKey {
}
private:
- static GitOpKeyMap const map_;
+ static GitOpKeyMap const kMap;
};
class CriticalGitOpGuard;