diff options
author | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2023-02-20 09:52:35 +0100 |
---|---|---|
committer | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2023-03-03 16:20:52 +0100 |
commit | 07864376504efde66c1e7b1b5185f84a531fe64c (patch) | |
tree | 62afac72f8f5828e7e2a41c838df9bdd221225e3 /src/other_tools/git_operations/git_repo_remote.cpp | |
parent | 6dcc58ed7745f2446107dce8c1cf69530c866dc1 (diff) | |
download | justbuild-07864376504efde66c1e7b1b5185f84a531fe64c.tar.gz |
GitRepoRemote: Add getter for config snapshot
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); +} |