From aa8635c6863646f5df78b54832f51db16aac25ba Mon Sep 17 00:00:00 2001 From: Maksim Denisov Date: Tue, 14 Jan 2025 17:59:01 +0100 Subject: TreeStructureUtils: export from git --- src/buildtool/tree_structure/tree_structure_utils.hpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/buildtool/tree_structure/tree_structure_utils.hpp') diff --git a/src/buildtool/tree_structure/tree_structure_utils.hpp b/src/buildtool/tree_structure/tree_structure_utils.hpp index df2f9f5e..4f908640 100644 --- a/src/buildtool/tree_structure/tree_structure_utils.hpp +++ b/src/buildtool/tree_structure/tree_structure_utils.hpp @@ -15,8 +15,10 @@ #ifndef INCLUDED_SRC_BUILDTOOL_TREE_STRUCTURE_TREE_STRUCTURE_UTILS_HPP #define INCLUDED_SRC_BUILDTOOL_TREE_STRUCTURE_TREE_STRUCTURE_UTILS_HPP +#include #include #include +#include #include "gsl/gsl" #include "src/buildtool/common/artifact_digest.hpp" @@ -59,6 +61,19 @@ class TreeStructureUtils final { StorageConfig const& target_config, gsl::not_null const& tagging_lock) noexcept -> expected; + + /// \brief Export a tree from source git repositories to target api. Uses + /// regular GitApi for retrieval from git and doesn't perform rehashing. + /// \param tree Tree to export + /// \param source_repos Repositories to check + /// \param target_api Api to export the tree to + /// \return True if target api contains tree after the call, false if none + /// of source repositories contain tree, or an error message on failure. + [[nodiscard]] static auto ExportFromGit( + ArtifactDigest const& tree, + std::vector const& source_repos, + IExecutionApi const& target_api) noexcept + -> expected; }; #endif // INCLUDED_SRC_BUILDTOOL_TREE_STRUCTURE_TREE_STRUCTURE_UTILS_HPP -- cgit v1.2.3