diff options
Diffstat (limited to 'src/buildtool/execution_api/common/blob_tree.cpp')
-rw-r--r-- | src/buildtool/execution_api/common/blob_tree.cpp | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/src/buildtool/execution_api/common/blob_tree.cpp b/src/buildtool/execution_api/common/blob_tree.cpp index 7224406a..e6d8fc2c 100644 --- a/src/buildtool/execution_api/common/blob_tree.cpp +++ b/src/buildtool/execution_api/common/blob_tree.cpp @@ -22,7 +22,6 @@ #include "src/buildtool/common/artifact.hpp" #include "src/buildtool/common/artifact_digest.hpp" -#include "src/buildtool/common/artifact_digest_factory.hpp" #include "src/buildtool/crypto/hash_function.hpp" #include "src/buildtool/file_system/git_repo.hpp" #include "src/buildtool/file_system/object_type.hpp" @@ -68,17 +67,13 @@ auto BlobTree::FromDirectoryTree(DirectoryTreePtr const& tree, } } if (auto git_tree = GitRepo::CreateShallowTree(entries)) { - auto digest = - ArtifactDigestFactory::Create(HashFunction::Type::GitSHA1, - ToHexString(git_tree->first), - git_tree->second.size(), - /*is_tree=*/true); - if (digest) { - return std::make_shared<BlobTree>( - ArtifactBlob{*std::move(digest), - git_tree->second, - /*is_exec=*/false}, - nodes); + auto blob = ArtifactBlob::FromMemory( + HashFunction{HashFunction::Type::GitSHA1}, + ObjectType::Tree, + std::move(git_tree)->second); + if (blob.has_value()) { + return std::make_shared<BlobTree>(*std::move(blob), + std::move(nodes)); } } } catch (...) { |