Mark content-addressable paths with references as experimental

This commit is contained in:
Eelco Dolstra 2019-10-21 18:05:31 +02:00
parent e68736936a
commit 629b9b0049
2 changed files with 6 additions and 1 deletions

View File

@ -1013,8 +1013,11 @@ void LocalStore::addToStore(const ValidPathInfo & info, Source & source,
std::unique_ptr<AbstractHashSink> hashSink;
if (info.ca == "")
hashSink = std::make_unique<HashSink>(htSHA256);
else
else {
if (!info.references.empty())
settings.requireExperimentalFeature("ca-references");
hashSink = std::make_unique<HashModuloSink>(htSHA256, storePathToHash(info.path));
}
LambdaSource wrapperSource([&](unsigned char * data, size_t len) -> size_t {
size_t n = source.read(data, len);

View File

@ -26,11 +26,13 @@ struct CmdHash : Command
mkFlag()
.longName("type")
.mkHashTypeFlag(&ht);
#if 0
mkFlag()
.longName("modulo")
.description("compute hash modulo specified string")
.labels({"modulus"})
.dest(&modulus);
#endif
expectArgs("paths", &paths);
}