Skip to content

Commit

Permalink
Merge pull request #12459 from NixOS/mergify/bp/2.26-maintenance/pr-1…
Browse files Browse the repository at this point in the history
…2458

lockFlake(): When refetching a locked flake, use the locked ref (backport #12458)
  • Loading branch information
mergify[bot] authored Feb 12, 2025
2 parents 49f226e + 0ff1901 commit b3e9204
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/libflake/flake/flake.cc
Original file line number Diff line number Diff line change
Expand Up @@ -554,12 +554,12 @@ LockedFlake lockFlake(

/* Get the input flake, resolve 'path:./...'
flakerefs relative to the parent flake. */
auto getInputFlake = [&]()
auto getInputFlake = [&](const FlakeRef & ref)
{
if (auto resolvedPath = resolveRelativePath()) {
return readFlake(state, *input.ref, *input.ref, *input.ref, *resolvedPath, inputPath);
return readFlake(state, ref, ref, ref, *resolvedPath, inputPath);
} else {
return getFlake(state, *input.ref, useRegistries, flakeCache, inputPath);
return getFlake(state, ref, useRegistries, flakeCache, inputPath);
}
};

Expand Down Expand Up @@ -640,7 +640,7 @@ LockedFlake lockFlake(
}

if (mustRefetch) {
auto inputFlake = getInputFlake();
auto inputFlake = getInputFlake(oldLock->lockedRef);
nodePaths.emplace(childNode, inputFlake.path.parent());
computeLocks(inputFlake.inputs, childNode, inputPath, oldLock, followsPrefix,
inputFlake.path, false);
Expand Down Expand Up @@ -668,7 +668,7 @@ LockedFlake lockFlake(
auto ref = (input2.ref && explicitCliOverrides.contains(inputPath)) ? *input2.ref : *input.ref;

if (input.isFlake) {
auto inputFlake = getInputFlake();
auto inputFlake = getInputFlake(*input.ref);

auto childNode = make_ref<LockedNode>(
inputFlake.lockedRef,
Expand Down

0 comments on commit b3e9204

Please sign in to comment.