1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-18 08:19:35 +01:00

Merge pull request #14574 from pkpbynum/pb/fix-registry-pin

Fix registry pin ref lookup
This commit is contained in:
Eelco Dolstra 2025-11-17 18:09:13 +00:00 committed by GitHub
commit f8141a2c26
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -189,7 +189,6 @@ struct CmdRegistryPin : RegistryCommand, EvalCommand
auto registry = getRegistry();
auto ref = parseFlakeRef(fetchSettings, url);
auto lockedRef = parseFlakeRef(fetchSettings, locked);
registry->remove(ref.input);
auto resolvedInput = lockedRef.resolve(fetchSettings, store).input;
auto resolved = resolvedInput.getAccessor(fetchSettings, store).second;
if (!resolved.isLocked(fetchSettings))
@ -197,6 +196,7 @@ struct CmdRegistryPin : RegistryCommand, EvalCommand
fetchers::Attrs extraAttrs;
if (ref.subdir != "")
extraAttrs["dir"] = ref.subdir;
registry->remove(ref.input);
registry->add(ref.input, resolved, extraAttrs);
registry->write(getRegistryPath());
}