diff options
author | Sascha Roloff <sascha.roloff@huawei.com> | 2022-07-08 11:49:31 +0200 |
---|---|---|
committer | Sascha Roloff <sascha.roloff@huawei.com> | 2022-08-05 14:41:31 +0200 |
commit | 82ae2aa5a8cfb14a1547a608844bedee218d2c2d (patch) | |
tree | 380c17fb2984339d5c92533ef6136fc6a573c00f /src/buildtool/common/repository_config.hpp | |
parent | ee56ad123c7d6eeec98c586df1976dfb6a624586 (diff) | |
download | justbuild-82ae2aa5a8cfb14a1547a608844bedee218d2c2d.tar.gz |
Allow to read git trees from global CAS as well as local workspace root
Diffstat (limited to 'src/buildtool/common/repository_config.hpp')
-rw-r--r-- | src/buildtool/common/repository_config.hpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/buildtool/common/repository_config.hpp b/src/buildtool/common/repository_config.hpp index e1144789..e6237e3f 100644 --- a/src/buildtool/common/repository_config.hpp +++ b/src/buildtool/common/repository_config.hpp @@ -61,6 +61,11 @@ class RepositoryConfig { : std::nullopt; } + [[nodiscard]] auto ReadTreeFromGitCAS( + std::string const& hex_id) const noexcept -> std::optional<GitTree> { + return git_cas_ ? GitTree::Read(git_cas_, hex_id) : std::nullopt; + } + [[nodiscard]] auto WorkspaceRoot(std::string const& repo) const noexcept -> FileRoot const* { return Get<FileRoot>( |