mirror of
https://github.com/NixOS/nix.git
synced 2025-11-16 23:42:43 +01:00
Use "raw pattern" for content address types
We weren't because this ancient PR predated it! This is actually a new version of the pattern which addresses some issues identified in #7479.
This commit is contained in:
parent
a6d00a7bfb
commit
c51d554c93
14 changed files with 118 additions and 87 deletions
|
|
@ -44,7 +44,7 @@ void write(const Store & store, Sink & out, const StorePath & storePath)
|
|||
|
||||
ContentAddress read(const Store & store, Source & from, Phantom<ContentAddress> _)
|
||||
{
|
||||
return parseContentAddress(readString(from));
|
||||
return ContentAddress::parse(readString(from));
|
||||
}
|
||||
|
||||
void write(const Store & store, Sink & out, const ContentAddress & ca)
|
||||
|
|
@ -134,7 +134,7 @@ void write(const Store & store, Sink & out, const std::optional<StorePath> & sto
|
|||
|
||||
std::optional<ContentAddress> read(const Store & store, Source & from, Phantom<std::optional<ContentAddress>> _)
|
||||
{
|
||||
return parseContentAddressOpt(readString(from));
|
||||
return ContentAddress::parseOpt(readString(from));
|
||||
}
|
||||
|
||||
void write(const Store & store, Sink & out, const std::optional<ContentAddress> & caOpt)
|
||||
|
|
@ -545,7 +545,7 @@ ref<const ValidPathInfo> RemoteStore::addCAToStore(
|
|||
conn->to
|
||||
<< wopAddToStore
|
||||
<< name
|
||||
<< renderContentAddressMethod(caMethod);
|
||||
<< caMethod.render();
|
||||
worker_proto::write(*this, conn->to, references);
|
||||
conn->to << repair;
|
||||
|
||||
|
|
@ -603,7 +603,7 @@ ref<const ValidPathInfo> RemoteStore::addCAToStore(
|
|||
}
|
||||
|
||||
}
|
||||
}, caMethod);
|
||||
}, caMethod.raw);
|
||||
auto path = parseStorePath(readString(conn->from));
|
||||
// Release our connection to prevent a deadlock in queryPathInfo().
|
||||
conn_.reset();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue