diff options
Diffstat (limited to 'src/buildtool/tree_structure/tree_structure_utils.hpp')
-rw-r--r-- | src/buildtool/tree_structure/tree_structure_utils.hpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/buildtool/tree_structure/tree_structure_utils.hpp b/src/buildtool/tree_structure/tree_structure_utils.hpp index 56dd1249..df2f9f5e 100644 --- a/src/buildtool/tree_structure/tree_structure_utils.hpp +++ b/src/buildtool/tree_structure/tree_structure_utils.hpp @@ -15,9 +15,13 @@ #ifndef INCLUDED_SRC_BUILDTOOL_TREE_STRUCTURE_TREE_STRUCTURE_UTILS_HPP #define INCLUDED_SRC_BUILDTOOL_TREE_STRUCTURE_TREE_STRUCTURE_UTILS_HPP +#include <mutex> #include <string> +#include "gsl/gsl" #include "src/buildtool/common/artifact_digest.hpp" +#include "src/buildtool/execution_api/common/execution_api.hpp" +#include "src/buildtool/storage/config.hpp" #include "src/buildtool/storage/storage.hpp" #include "src/buildtool/tree_structure/tree_structure_cache.hpp" #include "src/utils/cpp/expected.hpp" @@ -39,6 +43,22 @@ class TreeStructureUtils final { Storage const& storage, TreeStructureCache const& cache) noexcept -> expected<ArtifactDigest, std::string>; + + /// \brief Import a git tree from the given source to storage_config's git + /// repo. + /// \param tree GitSHA1 tree to import + /// \param source_api The source of the tree. Must be capable of + /// processing GitSHA1 trees. + /// \param target_config Config with target git repo. + /// \param tagging_lock Mutex to protect critical tagging operation + /// \return Digest of the tree that is available in the repo after the + /// call or an error message on failure. + [[nodiscard]] static auto ImportToGit( + ArtifactDigest const& tree, + IExecutionApi const& source_api, + StorageConfig const& target_config, + gsl::not_null<std::mutex*> const& tagging_lock) noexcept + -> expected<ArtifactDigest, std::string>; }; #endif // INCLUDED_SRC_BUILDTOOL_TREE_STRUCTURE_TREE_STRUCTURE_UTILS_HPP |