aboutsummaryrefslogtreecommitdiff
path: root/zenserver/upstream/upstreamcache.cpp
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2022-11-18 11:35:13 +0100
committerGitHub <[email protected]>2022-11-18 02:35:13 -0800
commit55225621f018904abf7e212320bb784dc64f8ac3 (patch)
tree3fb962e9e0553448f9d42612bb078ff072308e1c /zenserver/upstream/upstreamcache.cpp
parentmove BasicFile to zenutil to remove zenstore dependency from zen command (#190) (diff)
downloadzen-55225621f018904abf7e212320bb784dc64f8ac3.tar.xz
zen-55225621f018904abf7e212320bb784dc64f8ac3.zip
Add `import-project` and `export-project` (#183)
* Add `import-project` and `export-project` command line parsing
Diffstat (limited to 'zenserver/upstream/upstreamcache.cpp')
-rw-r--r--zenserver/upstream/upstreamcache.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/zenserver/upstream/upstreamcache.cpp b/zenserver/upstream/upstreamcache.cpp
index f9673bcd6..bc06653b9 100644
--- a/zenserver/upstream/upstreamcache.cpp
+++ b/zenserver/upstream/upstreamcache.cpp
@@ -253,7 +253,7 @@ namespace detail {
if (CompressedBuffer Chunk = CompressedBuffer::FromCompressed(SharedBuffer(AttachmentResult.Response)))
{
- Package.AddAttachment(CbAttachment(Chunk));
+ Package.AddAttachment(CbAttachment(Chunk, AttachmentHash.AsHash()));
}
else
{
@@ -337,7 +337,7 @@ namespace detail {
{
if (CompressedBuffer Chunk = CompressedBuffer::FromCompressed(SharedBuffer(BlobResult.Response)))
{
- Package.AddAttachment(CbAttachment(Chunk));
+ Package.AddAttachment(CbAttachment(Chunk, AttachmentHash.AsHash()));
}
}
});
@@ -1254,7 +1254,7 @@ namespace detail {
{
if (CompressedBuffer AttachmentBuffer = CompressedBuffer::FromCompressed(SharedBuffer(Value)))
{
- Package.AddAttachment(CbAttachment(AttachmentBuffer));
+ Package.AddAttachment(CbAttachment(AttachmentBuffer, IoHash::FromBLAKE3(AttachmentBuffer.GetRawHash())));
}
else
{
@@ -1312,8 +1312,9 @@ namespace detail {
}
BatchWriter.EndObject();
// Policy unspecified and expected to be Default
- BatchWriter.AddBinaryAttachment("RawHash"sv, IoHash::FromBLAKE3(Compressed.GetRawHash()));
- BatchPackage.AddAttachment(CbAttachment(Compressed));
+ IoHash Hash = IoHash::FromBLAKE3(Compressed.GetRawHash());
+ BatchWriter.AddBinaryAttachment("RawHash"sv, Hash);
+ BatchPackage.AddAttachment(CbAttachment(Compressed, Hash));
}
BatchWriter.EndObject();
}