diff options
author | Maksim Denisov <denisov.maksim@huawei.com> | 2024-09-10 10:39:43 +0200 |
---|---|---|
committer | Maksim Denisov <denisov.maksim@huawei.com> | 2024-09-11 14:52:07 +0200 |
commit | c42dd82439ea360decda04046d51ba96c09165fb (patch) | |
tree | 50481314349d5463e865e89e1db835602f603bd4 /src/buildtool/execution_api/common | |
parent | 6e2284eeea2baf3b0c7683749afdea2b37785f46 (diff) | |
download | justbuild-c42dd82439ea360decda04046d51ba96c09165fb.tar.gz |
Use ArtifactDigestFactory in TreeReaderUtils
...to create ArtifactDigests.
Diffstat (limited to 'src/buildtool/execution_api/common')
-rw-r--r-- | src/buildtool/execution_api/common/tree_reader_utils.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/buildtool/execution_api/common/tree_reader_utils.cpp b/src/buildtool/execution_api/common/tree_reader_utils.cpp index 250d8245..855c1842 100644 --- a/src/buildtool/execution_api/common/tree_reader_utils.cpp +++ b/src/buildtool/execution_api/common/tree_reader_utils.cpp @@ -132,13 +132,16 @@ auto TreeReaderUtils::ReadObjectInfos(GitRepo::tree_entries_t const& entries, for (auto const& [raw_id, es] : entries) { auto const hex_id = ToHexString(raw_id); for (auto const& entry : es) { - if (not store_info( + auto digest = + ArtifactDigestFactory::Create(HashFunction::Type::GitSHA1, + hex_id, + /*size is unknown*/ 0, + IsTreeObject(entry.type)); + if (not digest or + not store_info( entry.name, - Artifact::ObjectInfo{ - .digest = ArtifactDigest{hex_id, - /*size is unknown*/ 0, - IsTreeObject(entry.type)}, - .type = entry.type})) { + Artifact::ObjectInfo{.digest = *std::move(digest), + .type = entry.type})) { return false; } } |