1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-07 01:51:47 +02:00

Merge pull request #12164 from NixOS/mergify/bp/2.25-maintenance/pr-12157

parsePathFlakeRefWithFragment(): Handle 'path?query' without a fragment (backport #12157)
This commit is contained in:
Eelco Dolstra 2025-01-10 18:11:30 +01:00 committed by GitHub
commit c902a299a8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 126 additions and 109 deletions

View file

@ -63,3 +63,16 @@ flakeref=git+file://$rootRepo\?submodules=1\&dir=submodule
echo '"foo"' > "$rootRepo"/submodule/sub.nix
[[ $(nix eval --json "$flakeref#sub" ) = '"foo"' ]]
[[ $(nix flake metadata --json "$flakeref" | jq -r .locked.rev) = null ]]
# Test that `nix flake metadata` parses `submodule` correctly.
cat > "$rootRepo"/flake.nix <<EOF
{
outputs = { self }: {
};
}
EOF
git -C "$rootRepo" add flake.nix
git -C "$rootRepo" commit -m "Add flake.nix"
storePath=$(nix flake metadata --json "$rootRepo?submodules=1" | jq -r .path)
[[ -e "$storePath/submodule" ]]