diff options
Diffstat (limited to 'src/other_tools/git_operations/git_repo_remote.cpp')
-rw-r--r-- | src/other_tools/git_operations/git_repo_remote.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/other_tools/git_operations/git_repo_remote.cpp b/src/other_tools/git_operations/git_repo_remote.cpp index 177a4301..7d2ee7f4 100644 --- a/src/other_tools/git_operations/git_repo_remote.cpp +++ b/src/other_tools/git_operations/git_repo_remote.cpp @@ -15,6 +15,7 @@ #include <src/other_tools/git_operations/git_repo_remote.hpp> #include "fmt/core.h" +#include "src/buildtool/file_system/git_utils.hpp" #include "src/buildtool/logging/logger.hpp" extern "C" { @@ -403,3 +404,11 @@ auto GitRepoRemote::FetchViaTmpRepo(std::filesystem::path const& tmp_repo_path, return false; } } + +auto GitRepoRemote::GetConfigSnapshot() const -> std::shared_ptr<git_config> { + git_config* cfg_ptr{nullptr}; + if (git_repository_config_snapshot(&cfg_ptr, GetRepoRef().get()) != 0) { + return nullptr; + } + return std::shared_ptr<git_config>(cfg_ptr, config_closer); +} |