mirror of
https://github.com/NixOS/nix
synced 2025-06-24 22:11:15 +02:00
Merge pull request #13159 from NixOS/ignore-dir
Avoid unnecessarily updating old lock files with 'dir' parameters
This commit is contained in:
commit
6fdb170fb3
5 changed files with 117 additions and 1 deletions
|
@ -32,6 +32,7 @@ suites += {
|
|||
'symlink-paths.sh',
|
||||
'debugger.sh',
|
||||
'source-paths.sh',
|
||||
'old-lockfiles.sh',
|
||||
],
|
||||
'workdir': meson.current_source_dir(),
|
||||
}
|
||||
|
|
60
tests/functional/flakes/old-lockfiles.sh
Normal file
60
tests/functional/flakes/old-lockfiles.sh
Normal file
|
@ -0,0 +1,60 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
source ./common.sh
|
||||
|
||||
requireGit
|
||||
|
||||
repo="$TEST_ROOT/repo"
|
||||
|
||||
createGitRepo "$repo"
|
||||
|
||||
cat > "$repo/flake.nix" <<EOF
|
||||
{
|
||||
inputs = {
|
||||
dependency.url = "git+file:///no-such-path?dir=subdir";
|
||||
};
|
||||
outputs = { dependency, self }: {
|
||||
hi = dependency.an_output;
|
||||
};
|
||||
}
|
||||
EOF
|
||||
|
||||
cat > "$repo/flake.lock" <<EOF
|
||||
{
|
||||
"nodes": {
|
||||
"dependency": {
|
||||
"locked": {
|
||||
"dir": "subdir",
|
||||
"lastModified": 1746721011,
|
||||
"narHash": "sha256-9aIDvIdyHAfQyvT5SwPgYxUUhf1GwQVAWq+qa5LcEQE=",
|
||||
"ref": "refs/heads/master",
|
||||
"rev": "432058dbfc82b0369bc9cce440e4af2aece52b54",
|
||||
"revCount": 1,
|
||||
"type": "git",
|
||||
"url": "file:///no-such-path?dir=subdir"
|
||||
},
|
||||
"original": {
|
||||
"dir": "subdir",
|
||||
"type": "git",
|
||||
"url": "file:///no-such-path?dir=subdir"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"dependency": "dependency"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
||||
EOF
|
||||
|
||||
git -C "$repo" add flake.nix flake.lock
|
||||
git -C "$repo" commit -a -m foo
|
||||
|
||||
cp "$repo/flake.lock" "$repo/flake.lock.old"
|
||||
|
||||
nix flake lock "$repo"
|
||||
|
||||
cmp "$repo/flake.lock" "$repo/flake.lock.old"
|
Loading…
Add table
Add a link
Reference in a new issue