aboutsummaryrefslogtreecommitdiff
path: root/src/nix/registry.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2022-12-07 12:58:58 +0100
committerEelco Dolstra <edolstra@gmail.com>2022-12-07 14:06:34 +0100
commit703d863a48f549b2626382eda407ffae779f8725 (patch)
treee38d101d192accd9099a5f0d0aaf8ff14c4ca0f3 /src/nix/registry.cc
parentc4a6113800dd3aa4eb95b74853c844331af82f1e (diff)
Trivial changes from the lazy-trees branch
Diffstat (limited to 'src/nix/registry.cc')
-rw-r--r--src/nix/registry.cc8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/nix/registry.cc b/src/nix/registry.cc
index c496f94f8..b5bdfba95 100644
--- a/src/nix/registry.cc
+++ b/src/nix/registry.cc
@@ -183,14 +183,12 @@ struct CmdRegistryPin : RegistryCommand, EvalCommand
void run(nix::ref<nix::Store> store) override
{
- if (locked.empty()) {
- locked = url;
- }
+ if (locked.empty()) locked = url;
auto registry = getRegistry();
auto ref = parseFlakeRef(url);
- auto locked_ref = parseFlakeRef(locked);
+ auto lockedRef = parseFlakeRef(locked);
registry->remove(ref.input);
- auto [tree, resolved] = locked_ref.resolve(store).input.fetch(store);
+ auto [tree, resolved] = lockedRef.resolve(store).input.fetch(store);
fetchers::Attrs extraAttrs;
if (ref.subdir != "") extraAttrs["dir"] = ref.subdir;
registry->add(ref.input, resolved, extraAttrs);