Skip to content

Commit 9d088fa

Browse files
committed
tests/flakes: check git+file:./${submodule} protocol
Relative, local git repo used to work (for submodules), but it fails after 3e0129c. This commit adds a test to prevent such failure in the future.
1 parent 96bd9ba commit 9d088fa

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/functional/flakes/flakes.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,14 @@ nix build -o "$TEST_ROOT/result" "git+file://$flake1Dir#default"
106106
nix build -o "$TEST_ROOT/result" "$flake1Dir?ref=HEAD#default"
107107
nix build -o "$TEST_ROOT/result" "git+file://$flake1Dir?ref=HEAD#default"
108108

109+
# Check that relative paths are allowed for git flakes.
110+
# This may change in the future once git submodule support is refined.
111+
# See: https://discourse.nixos.org/t/57783 and #9708.
112+
(
113+
cd "$flake1Dir/.."
114+
nix build -o "$TEST_ROOT/result" "git+file:./$(basename "$flake1Dir")"
115+
)
116+
109117
# Check that store symlinks inside a flake are not interpreted as flakes.
110118
nix build -o "$flake1Dir/result" "git+file://$flake1Dir"
111119
nix path-info "$flake1Dir/result"

0 commit comments

Comments
 (0)