1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-28 17:51:15 +02:00

wopAddToStore: add RepairFlag

This commit is contained in:
Robert Hensing 2020-09-18 10:06:34 +02:00
parent fbf509c113
commit 7c68264085
3 changed files with 9 additions and 7 deletions

View file

@ -353,6 +353,9 @@ static void performOp(TunnelLogger * logger, ref<Store> store,
auto name = readString(from);
auto camStr = readString(from);
auto refs = readStorePaths<StorePathSet>(*store, from);
bool repairBool;
from >> repairBool;
auto repair = RepairFlag{repairBool};
logger->startWork();
StorePath path = [&]() -> StorePath {
@ -368,7 +371,7 @@ static void performOp(TunnelLogger * logger, ref<Store> store,
[&](FixedOutputHashMethod &fohm) -> StorePath {
if (!refs.empty())
throw UnimplementedError("cannot yet have refs with flat or nar-hashed data");
return store->addToStoreFromDump(source, name, fohm.fileIngestionMethod, fohm.hashType);
return store->addToStoreFromDump(source, name, fohm.fileIngestionMethod, fohm.hashType, repair);
},
}, contentAddressMethod);
}();