1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-25 19:01:16 +02:00

Merge pull request #3746 from obsidiansystems/path-info

Introduce `StoreReferences` and `ContentAddressWithReferences`
This commit is contained in:
Robert Hensing 2023-04-17 15:49:48 +02:00 committed by GitHub
commit e641de085b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
27 changed files with 578 additions and 243 deletions

View file

@ -293,7 +293,13 @@ SV * makeFixedOutputPath(int recursive, char * algo, char * hash, char * name)
try {
auto h = Hash::parseAny(hash, parseHashType(algo));
auto method = recursive ? FileIngestionMethod::Recursive : FileIngestionMethod::Flat;
auto path = store()->makeFixedOutputPath(method, h, name);
auto path = store()->makeFixedOutputPath(name, FixedOutputInfo {
.hash = {
.method = method,
.hash = h,
},
.references = {},
});
XPUSHs(sv_2mortal(newSVpv(store()->printStorePath(path).c_str(), 0)));
} catch (Error & e) {
croak("%s", e.what());